$near query with Meteor Accounts



I wanna do a query returning Meteor Accounts sorted by which is the nearest. I’ve have already geo coded the addresses provided upon signing up, and placed them in lng & lat fields in the profile object.

But when I want to use Mongo’s $near query, I has to be within the “loc” array - can I in some way (upon signing up) place the lat and lng values in the loc array (which has to be at “root” level of the document)?

Or how should I go about this?

Thanks in advance


refer : http://docs.mongodb.org/v2.4/reference/operator/query/near/