mongoDB多級子文檔查詢

db.getCollection('product').find({'coverage':{'$elemMatch':{'plan':{'$elemMatch':{'iscoverage':{'$in':['1']}}}}}})數組

其中,coverage是文檔的第一級子文檔,$elemMatch匹配的是數組,而後plan是數組裏面的字段,其餘同樣文檔

相關文章
相關標籤/搜索