Database
[{"_id":ObjectId("5de7d0d65223850135eac968"),groupName:"AGroup",primaryField:"EMail",FieldsData:[{EMail:"abc@gmail.com",otherField:123},{EMail:"def@outlook.com",otherField:345}]},{"_id":ObjectId("5de7d0d65223850135eac969"),groupName:"BGroup",primaryField:"userEmail",FieldsData:[{userEmail:"hij@hotmail.com",otherField:678},{userEmail:"kl@outlook.com",otherField:910}]}]
Query
db.collection.aggregate([{$project:{_id:1,MailList:{$map:{input:"$FieldsData",in:{$let:{vars:{element:{$arrayElemAt:[{$filter:{input:{$objectToArray:"$$this"},cond:{$eq:["$$this.k","$primaryField"]}}},0]}},in:"$$element.v"}}}}}}])