Start a new topic

Max distance for _geoloc/$nearsphere

What is the unit for the $maxDistance parameter on geo based queries? I'm using the following math but I'm not sure if it's right:

metersToMiles = 0.000621371;

maxDistance = radiusInKilometers * 1000 * metersToMiles / 3963.192;

For example, for a radius of 15km the query body is the following:


any help?


Neto, are you using the REST API or this with business logic?
Hi Michael! I'm using both collection hook and iOS Framework
When using the iOS library (or the REST API) specify maxDistance in miles. When using business logic, such as with a collection hook, the maxDistance is specified in radians. ( might be helpful)
Login or Signup to post a comment