Database
db={example_lists:[{"_id":ObjectId("5a934e000102030405000000"),"example_list":[{"external_id":ObjectId("5a934e000102030405000001"),"other":"stuff"},{"external_id":ObjectId("5a934e000102030405000002"),"other":"stuff"},{"external_id":ObjectId("5a934e000102030405000003"),"other":"stuff"}]}],example_collection:[{"_id":ObjectId("5a934e000102030405000001"),"external_data":"data1 retrieved from lookup"},{"_id":ObjectId("5a934e000102030405000002"),"external_data":"data2 retrieved from lookup"},{"_id":ObjectId("5a934e000102030405000003"),"external_data":"data3 retrieved from lookup"}]}
Query
db.example_lists.aggregate([{$lookup:{from:"example_collection",localField:"example_list.external_id",foreignField:"_id",as:"example_list2"}},{$set:{example_list2:"$$REMOVE",example_list:{$map:{input:"$example_list",in:{$mergeObjects:["$$this",{$arrayElemAt:["$example_list2",{$indexOfArray:["$example_list2._id","$$this.external_id"]}]}]}}}}}])