Add operator that would calculate distance between 2 geolocation points
It would be great to have operator that would calculate distance between 2 geolocation points, and not to do it manually with big aggregate queries.
I suggest to add 2 new operators that would calculate distance in two different ways, as discussed in this Community Post: https://www.mongodb.com/community/forums/t/how-to-calculate-distance-between-two-geolocation-points/173045
![](https://secure.gravatar.com/avatar/b68a6f76667b6b6a7f1130b5f7197cd1?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Sapient commented
having same use case as mentioned , it would be great addition .
-
Chaim Klar commented
Having the same use case as @adam, so yes; please add it
-
Adam Butler commented
I could really use this operator right now! Definitely got my vote.
Although in addition to the implementation discussed in the linked post above (calculating distance between two points both within the documents), I would also like to be able to calculate distance between one Point within my documents and a static point provided within the query. For example, if I wanted to calculate distance between a central location and a bunch of Points within my documents.