Database

[{"_id":"000","name":"foo bar","text":"testing one","threadDescendant":"123",},{"_id":"234","name":"foo bar","text":"testing four","threadDescendant":"345"},{"_id":"345","name":"foo bar","text":"testing three",},{"_id":"123","name":"foo bar","text":"testing two","threadDescendant":"234"}]

Query

db.collection.aggregate([{$match:{_id:"000"}},{$graphLookup:{from:"collection",startWith:"$threadDescendant",connectFromField:"threadDescendant",connectToField:"_id",as:"posteriorThread",},},{$unwind:"$posteriorThread",},{$sort:{"posteriorThread.depth":1},},{$group:{_id:"$_id",posteriorThread:{$push:"$posteriorThread"},root:{$first:"$$ROOT"}}},{$project:{"root.posteriorThread":0}},{$replaceRoot:{newRoot:{$mergeObjects:[{posteriorThread:"$posteriorThread"},"$root"]}}}])

Result