mongodb查询size大于1的内嵌list的document

db.user_profile.find({ $where: "this.disk_rack.length > 1" } )
但是这种js引擎执行的会非常慢

更好的办法是
CreateextrafieldNamesArrayLength, update it with names array length and then use in queries:
db.accommodations.find({"NamesArrayLength": {$gt: 1} });

It will be better solution, and will work much faster (you can create index on it).

文章题目:mongodb查询size大于1的内嵌list的document
当前URL:http://csdahua.cn/article/ijpppp.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流