Database

[{"_id":ObjectId("63e37afe7a3453d5014c011b"),"schemaVersion":NumberInt(1),"Id":ObjectId("63e37afe7a3453d5014c0112"),"Id1":ObjectId("63e37afe7a3453d5014c0113"),"Id2":ObjectId("63e37afe7a3453d5014c0114"),"collectionName":"Country","List":[{"countryId":NumberInt(1),"name":"Afghanistan",},{"countryId":NumberInt(1),"name":"India",},{"countryId":NumberInt(1),"name":"USA",}]}]

Query

db.collection.aggregate([{"$match":{"Id":ObjectId("63e37afe7a3453d5014c0112"),"Id1":ObjectId("63e37afe7a3453d5014c0113"),"Id2":ObjectId("63e37afe7a3453d5014c0114"),"collectionName":"Country","List.name":"Afghanistan",}},{"$project":{"country":{"$arrayElemAt":[{"$filter":{"input":"$List","cond":{"$eq":["$$this.name","Afghanistan"]}}},0]}}},{"$project":{"_id":0,"countryId":"$country.countryId","name":"$country.name"}}])

Result