Let's use a down-to-earth geolocation approach (ah! I'm so funny) to the match. We have to be realistic. Our service was born in Smallville but it's going global and we can't match people who are too far apart.
Because our meetings are arranged free of racing conditions on the Meeting
collection and we would like to keep it that way, let's adapt our existing pair
method to incorporate the user's location. We can assume that at registration, they will supply their location (or we could also easily update the meeting document once they provide the location). In our existing strategy, we have one user who creates a meeting document; in this case, let's also set their location, so the next user looking for a match will have to be in a similar location as an additional constraint, as shown in the following code:
'''javascript Meeting.ensureIndex({location1: "2dsphere"}); //.. methods.pair = function(user,done) { methods.userMatchHistory(user, function(err, emailList...