Database
db={"users":[{"_id":"a","email":"a@test.com",},{"_id":"b","email":"b@test.com",},{"_id":"c","email":"c@test.com",}],"friends":[{"userId":"a","otherUserId":"b"},{"userId":"a","otherUserId":"c"},],"emailsSent":[{"userId":"a","number":"25"},{"userId":"b","number":"3"},]}
Query
db.users.aggregate([{"$match":{"$expr":{"$eq":["$_id","a"]}}},{"$lookup":{"from":"friends","localField":"_id","foreignField":"userId","as":"myfriends"}},{"$unwind":{"path":"$myfriends"}},{"$lookup":{"from":"users","localField":"myfriends.otherUserId","foreignField":"_id","as":"myfriendsEmails"}},{"$unwind":{"path":"$myfriendsEmails"}},{"$set":{"myfriends.email":"$myfriendsEmails.email"}},{"$unset":["myfriendsEmails","myfriends._id","myfriends.userId"]},{"$lookup":{"from":"emailsSent","localField":"myfriends.otherUserId","foreignField":"userId","as":"friendsEmails"}},{"$unwind":{"path":"$friendsEmails","preserveNullAndEmptyArrays":true}},{"$set":{"myfriends.number":"$friendsEmails.number"}},{"$unset":["friendsEmails"]},{"$group":{"_id":"$_id","email":{"$first":"$email"},"friends":{"$push":"$myfriends"}}}])