MongoDB geoNear query returns wrong distance

239 Views Asked by At

I am getting wrong distance using mongodb geonear query. What I have done till now.

  1. Saved the lat-long as
    "Coordinates" : { "Longitude" : 174.811937, "Latitude" : -36.880177 }

  2. Created 2d Index on Coordinates field of collection

  3. distance returned is "distance": 253.33004896638525

I also tried 2dsphere index but result is same. Please let me know if anything that i am missing

db.collection('RestaurentMaster').aggregate([{
    $geoNear : {
        near : [174.780599, -36.855702],
        distanceMultiplier : 6371,
        distanceField : "distance",
        spherical : false,
        limit : 10,
        query : {...}
    }
}])
0

There are 0 best solutions below