I have already been facing issues in meteor when dealing with reactive sorting of a publication according to various data. Every time, I never found a real answer to what I was trying to achieve and I ended up giving up and just deciding "not to build my app that way", which always makes me really sad.
Now maybe I can phrase this problem simply enough that it could get a constructive and very interesting answer. I think it sounds like it should be possible to be done in a Meteor app, so here it is:
I store the locations of my users in "lat" and "lon" variables in my Accounts.users collection. I want the current user to get a list of, say, the 10 closest users to him or her. How would I do this, considering the seemingly complicated set of operations needed to get that distance from latitude and longitude?
As far as I know, it is pretty much impossible to insert such an equation in a MongoDB query condition. So how do other people achieve this feat?
I would appreciate any insight on this problem, as theoretical as it may be.