Database

db={"client":[{"_id":1,"razaosocial":"32423424","prepository":[1]}],"prepository":[{"_id":1,"name":"Jonh","representative":1}],"representative":[{"_id":1,"name":"Josh"}]}

Query

db.client.aggregate([{$lookup:{from:"prepository",as:"prepository",let:{prepository:"$prepository"},pipeline:[{$match:{$expr:{$in:["$_id","$$prepository"]}}},{$lookup:{from:"representative",localField:"representative",foreignField:"_id",as:"representative"}},{$unwind:"$representative"}]}}])

Result