Database

db={"BusDetails":[{"busNumber":"KA25D5057","cityId":"17","revenue":46594924,"totalCollection":3456342,"tax":"2906","passengerCount":40}]}

Query

db.BusDetails.aggregate([{$match:{busNumber:"KA25D5057"}},{"$addFields":{/** put your object here*/"cityConfiguration":{_id:ObjectId("62e135519567726de42421c2"),configType:"cityConfig","16":{cityName:"Delhi",metro:true,tier1:true},"17":{cityName:"Indore",metro:false,tier1:false}}}},{"$addFields":{/** convert into array of k-v tuples*/"cityConfiguration":{"$objectToArray":"$cityConfiguration"}}},{"$addFields":{"cityConfiguration":{/** iterate through the array and get the matched cityConfiguration entry*/"$reduce":{"input":"$cityConfiguration","initialValue":null,"in":{"$cond":{"if":{$eq:["$$this.k","$cityId"]},"then":"$$this.v","else":"$$value"}}}}}},{$project:{totalCollection:1,passengerCount:1,metro:{"$cond":{"if":"$cityConfiguration.metro","then":1,"else":0}}}}])

Result