Database

db={"students":[{"_id":ObjectId("5f22ef443f17d8235332bbbe"),"fullname":"John Smith","email":"example.com"},{"_id":ObjectId("5f281ad0838c6885856b6c01"),"fullname":"Erlanie Jones","email":"example.com"},{"_id":ObjectId("5f64add93dc79c0d534a51d0"),"fullname":"Krishna Kumar","email":"example.com"}],"exams":[{"test":"Sample Test #1",top10:[{studentId:ObjectId("5f22ef443f17d8235332bbbe"),score:11},{studentId:ObjectId("5f281ad0838c6885856b6c01"),score:9},{studentId:ObjectId("5f64add93dc79c0d534a51d0"),score:5}]}]}

Query

db.exams.aggregate([{$lookup:{from:"students",localField:"top10.studentId",foreignField:"_id",as:"students"}},{$project:{test:1,students:{$map:{input:"$top10",as:"top10",in:{$mergeObjects:["$$top10",{fullname:{$reduce:{input:"$students",initialValue:0,in:{$cond:[{$eq:["$$this._id","$$top10.studentId"]},"$$this.fullname","$$value"]}}}}]}}}}}])

Result