Start a new topic

How to get distance in miles, in location query?

I understand that by doing --- query.near('_geoloc', coord, 10); gives me all restaurants ordered by distance within 10 miles. But what is that distance value? is there any way to get it?
1 Comment

This is not returned as part of the query. However, given that you have `coord`, and the returned restaurants will have a `_geoloc` field, you can use the [Haversine formula]( to calculate the distance yourself.
Login or Signup to post a comment