Database
db={"User":[{_id:"5f1acd6e6985114f2c1567ea",name:"test user",email:"test@email.com"}],"Talent":[{_id:"5f1acd6e6985114f2c1567fa",categoryId:"5f1acd6e6985114f2c1567ga",userId:"5f1acd6e6985114f2c1567ea",level:"5",}],"TalentMedia":[{_id:"5f1acd6e6985114f2c156710",talentId:"5f1acd6e6985114f2c1567fa",media:"file.jpg",fileType:"image"}],"Category":[{_id:"5f1acd6e6985114f2c1567ga",title:"java"}]}
Query
db.User.aggregate([{$lookup:{from:"Talent",as:"talents",let:{userId:"$_id"},pipeline:[{$match:{$expr:{$eq:["$$userId","$userId"]}}},{$lookup:{from:"Category",as:"categoryId",localField:"categoryId",foreignField:"_id"}},{$unwind:{path:"$categoryId",preserveNullAndEmptyArrays:true}},{$lookup:{from:"TalentMedia",as:"medias",let:{talentId:"$_id"},pipeline:[{$match:{$expr:{$eq:["$$talentId","$talentId"]}}},{$project:{"talentId":0}}]}},{$project:{"userId":0}}]}}])