Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
db={"X":[{"uid":"dfdf"}],"Y":[{"name":"bfbf"}]}
Query
db.Y.aggregate([{"$lookup":{"from":"X","pipeline":[],"as":"x"}},{"$unwind":"$x"},{$set:{"uid":"$x.uid"}},{"$unset":"x"}])
Result