I am wondering if it is possible to use a mongodb geospatial index with Meteor architecture.
Minimongo does not implement geospatial indices, but does this mean that we cannot use this mongo feature on the server side?
For example, with the todos app, if we use location on the todo, will it be possible to do:
// Publish complete set of lists to all clients.
Meteor.publish('todos', function (lon,lat) {
return Todos.find({loc: {$near:[lon,lat]}}).limit(2);
});
And on the client side :
Meteor.subscribe('todos', lon, lat );
.db
didn't appear for me right away. I had to wrap myensureIndex
call in asetTimeout
to give it time to show up. I'm hazarding a guess that the database is "connecting" and only appears as a key on.mongo
once the connection is established. I set it up with a 15 second delay just to be sure, as I don't care too much about subsequent calls -- calling ensureIndex once is all I really need – Sacrum