MongoDB Geospatial Query Count Issue (Always 100) -
it appears there issue count operation on geospatial query contains more 100 results. if run following query still count of 100 no matter what.
db.locations.find({"loc":{$nearsphere:[50, 50]}}).limit(1000).count()
i understand default size limit on query uses "near" syntax 100 appears cannot return more that. doing wrong or there workaround this?
try "within" instead of "near". works me,
center = [50, 50]; radius = 1/111.12; //convert km. db.places.count({"loc" : {"$within" : {"$center" : [center, radius]}}})
Comments
Post a Comment