MongoDB geo distance/radius to useful units

前端 未结 3 770
感情败类
感情败类 2021-02-10 00:41

I\'m using MongoDB geospatial queries -- $near, geoNear, etc. -- and I\'d like to know how to turn the dis result of the geoNear

3条回答
  •  礼貌的吻别
    2021-02-10 01:28

    Using geoNear command for a dis value in kilometers add the parameter:

    distanceMultiplier: (6371 * Math::PI / 180.0)
    

提交回复
热议问题