How about performance for the $near operation in mongodb(meteor) -
i using meteor implement 'near' query. in fact, works well. wondering how performance server side.
this code near query:
var geolocation = session.get('location'); var lnglat = [0,0]; if(geolocation){ lnglat = [geolocation.longitude,geolocation.latitude]; } if(session.get('type') === 'near'){ homecoming posts.find({ location: { $near: { $geometry: { type: "point", coordinates: lnglat }, $maxdistance: 20000 //meters } } }); }
the best reply lies in mongodb source code in github (obviously! duh!). according documentation, of import ensure indexes. link: http://docs.mongodb.org/manual/core/geospatial-indexes/
performance mongodb search meteor
No comments:
Post a Comment