Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{foo:{bar:1},some_array:[{xyz:1},{xyz:2}]},{foo:{bar:2},some_array:[{xyz:123},{xyz:321}]}]
Query
db.collection.aggregate([{$match:{$expr:{$in:["$foo.bar","$some_array.xyz"]}}}])
Result