135-1821-9792

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
链接地址:http://ahjierui.cn/article/ijpppp.html

其他资讯



Copyright © 2009-2022 www.ahjierui.cn 青羊区美图云海设计工作室(个体工商户) 版权所有 蜀ICP备19037934号