Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{"_id":1,"participants":[1,2],"messages":[],},{"_id":2,"participants":[2,3],"messages":[],},{"_id":3,"participants":[1,3],"messages":[],}]
Query
db.collection.find({"participants":{"$all":[1,2]}})
Result