Database
db={"questions":[{"_id":1,"title":"first","content":"content"}],"answers":[{"_id":1,"questionId":1,"content":"test"},{"_id":2,"questionId":1,"content":"test"}],"comments":[{"_id":1,"idQuestion":1,"idAnswer":1,"content":"hello"},{"_id":2,"idQuestion":1,"idAnswer":2,"content":"hi"}]}
Query
db.questions.aggregate([{$match:{_id:1}},{$lookup:{from:"answers",let:{questionId:"$_id"},pipeline:[{$match:{$expr:{$eq:["$$questionId","$questionId"]}}},{$lookup:{from:"comments",localField:"_id",foreignField:"idAnswer",as:"comments"}}],as:"answers"}}])