Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加对子集中数组的处理. #43

Open
tonysmz opened this issue Jun 17, 2017 · 1 comment
Open

增加对子集中数组的处理. #43

tonysmz opened this issue Jun 17, 2017 · 1 comment

Comments

@tonysmz
Copy link

tonysmz commented Jun 17, 2017

希望增加对子集中数组的处理功能,目前的方法,只能对子集进行整个替换,效率太低.

  1. 在子集数组中增加一项,用$push
    2.修改子集数组的某一栏,用{$set:{arrayname.$.colname,value)}
    3.替换子集数组中的某一行,用{$set:{arrayname.$,value}}, 该种情况必须保证查询条件可以查到有效的结果集,否则更新时会报错.
@xieqiang1724
Copy link

希望增加对子集中数组的处理功能,目前的方法,只能对子集进行整个替换,效率太低.

  1. 在子集数组中增加一项,用$push
    2.修改子集数组的某一栏,用{$set:{arrayname.$.colname,value)}
    3.替换子集数组中的某一行,用{$set:{arrayname.$,value}}, 该种情况必须保证查询条件可以查到有效的结果集,否则更新时会报错.

您好,请问最近还在使用mongodb plugin吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants