有个表中有个字段audioMaterialList,字段类型为list,假如需要查询字段里面的item数量超过10个的记录,可以通过如下聚合语句
db.getCollection('realize_novel_book').aggregate([
{
"$match": {
"audioMaterialList": { "$exists": true }
}
},
{
"$project": {
"audioMaterialCount": { "audioMaterialList" }
}
},
{
"$match": {
"audioMaterialCount": { "$gt": 10 }
}
}
])
岳阳市网站建设_网站建设公司_CMS_seo优化