Database

db={cats:[{"name":"Kitty","ballId":"507c7f79bcf86cd7994f6c0e"}],balls:[{"_id":ObjectId("507c7f79bcf86cd7994f6c0e"),"color":"green"},{"_id":ObjectId("507c7f79bcf86cd7994f6c0f"),"color":"green"}]}

Query

db.cats.aggregate([{$match:{}},{$lookup:{from:"balls",let:{ballId:"$ballId"},pipeline:[{$match:{$expr:{$eq:[{"$toString":"$_id"},"$$ballId"]},}}],as:"balls"}}])

Result