Database
db={Students:[{"id":"123","title":"John","marks_in_subjects":[{"marks":90,"subject_id":"abc"},{"marks":92,"subject_id":"def"}]}],Subjects:[{"id":"abc","name":"math"},{"id":"def","name":"physics"}]}
Query
db.Students.aggregate([{$unwind:"$marks_in_subjects"},{"$lookup":{"from":"Subjects","localField":"marks_in_subjects.subject_id","foreignField":"id","as":"subjects"}},{$group:{_id:"$id",title:{$first:"$title"},subjects:{$push:{$first:"$subjects"}}}},{$set:{subjects:{$concatArrays:[[{titleAll:"$title"}],{$map:{input:"$subjects",in:{titleAll:{$concat:["$title"," > ","$$this.name"]}}}}]}}},{$unwind:"$subjects"},{$project:{_id:1,title:1,titleAll:"$subjects.titleAll"}}])