小编rah*_*ave的帖子

MongoDB:混合$ all和$ elemMatch

我有一个包含5个项目的"项目",每个项目都有一个id和一个数组

{ _id: ObjectId("51c21bec162c138d9d0001a7"), 
    tags: [ { name: "a", type: "tag" }, { name: "b", type: "tag" }, { name: "c", type: "note" } ] 
}
{ _id: ObjectId("51c21ca22c69904840000178"), 
    tags: [ { name: "a", type: "tag" }, { name: "d", type: "tag" }, { name: "c", type: "note" } ] 
}
{ _id: ObjectId("51c21cc1478cf6691a0001b4"), 
    tags: [ { name: "d", type: "tag" }, { name: "b", type: "tag" }, { name: "c", type: "note" } ] 
}
{ _id: ObjectId("51c22292162c13b1ff000222"), 
    tags: …
Run Code Online (Sandbox Code Playgroud)

mongodb

6
推荐指数
1
解决办法
3598
查看次数

标签 统计

mongodb ×1