Database

db={posts:[{"id":"1","comments":[{_id:"c1",userId:"u1",text:"Hi there, who are you?"},{_id:"c2",userId:"u1",text:"Hi! Are you still there?"},]},],users:[{"_id":"u1","name":"James","username":"jamo"},]}

Query

db.posts.aggregate({$lookup:{from:"users",let:{comments:"$comments"},pipeline:[{$match:{$expr:{$in:["$_id","$$comments.userId"]}}},{"$addFields":{"text":"$$comments.text"}}],as:"comments"}})

Result