Start a new topic

how to query nearsphear from prefetch collection hook

i have a collection store as follow { _id,_geoloc,name} and i use this collection access: collectionAccess.collection('store').find({ _geoloc: { "$nearSphere" : [30.11045788301719,31.34927760084216], "$maxDistance":1}},function(error,stores){ if(error){ logger.error(error.message); }else {; response.body=stores; response.complete(200); } }); but it doesn't return the right result for maxdistance how should it be done

Good evening Elnaqah, What is the result that it's returning that you consider "wrong" ? Thanks,
it return all stores doesn't consider the maxDistance
for example it get me store with this coordinate [25.23475475717982,55.435291280517504]
Login or Signup to post a comment