Database

[{"_id":"001","location":"PARIS FRANCE","country":"FRANCE"},{"_id":"002","location":"TORONTO","country":"CANADA"}]

Query

db.collection.aggregate([{"$set":{"isIn":{"$gte":[{"$sum":[{/** returns pos or -1 if not found*/"$indexOfCP":["$location","$country"]},{"$indexOfCP":["$country","$location"]}]},-1]}}}])

Result