Database

[{"collection":"languages","count":5,"content":{"_id":{"type":"ref","id":1,"refContent":{"type":"objectId"}},"code":{"type":"fromArray","in":["ab","aa","af","ak","sq"]},"name":{"type":"fromArray","in":["Abkhaz","Afar","Afrikaans","Akan","Albanian"]},"nativeName":{"type":"fromArray","in":["аҧсуа","Afaraf","Afrikaans","Akan","Shqip"]}}},{"collection":"textSamples","count":100,"content":{"languageId":{"type":"ref","id":1},"someTextField":{"type":"string","minLength":10,"maxlength":200}}}]

Query

db.textSamples.aggregate([{"$lookup":{"from":"languages","localField":"languageId","foreignField":"_id","as":"language"}}])

Result