mongo根据数组长度查询

原文:https://www.itranslater.com/qa/details/2105880015459058688

https://stackoverflow.com/questions/7811163/query-for-documents-where-array-size-is-greater-than-1

 

({"ids":{"$exists":true, "$ne":[], "$not":{"$size":1}}})

({$expr:{$gt:[{$size:"$ids"}, 1]}})

({'ids.1': {$exists: true}})

 

posted @ 2022-02-26 17:12  一去二三浪里小白龙  阅读(250)  评论(0编辑  收藏  举报
//增加一段JS脚本,为目录生成使用