Mongodb – mongo query : How can a direct key-value pair be placed from a nested array in a single stage pipeline and without the use of $unwind?
I have something like this. { "priceDetails": [ { "cities": [ { "cityId": "64a297a8bb1dc440ccef6c3c", "name": "Bhopal", "prices": "1200", "commissionType": "PERCENTAGE", "commissionValue": "20", "_id": "64a2990b344e735476fb54ca" } ] } ] } Need something like this. { "priceDetails": { "cityId": "64a297a8bb1dc440ccef6c3c", "name": "Bhopal",…