-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.7.4
-
Component/s: Geo
-
None
-
ALL
Here are my tests:
// Radius of the earth: 3959.8728
// Distance to Maplewood, NJ (in radians): 0.0036998565637149016
// Distance to Maplewood, NJ (in miles 0.0036998565637149016 * 3959.8728): 14.65
// Does not return Maplewood
db.example.find( { loc: { $nearSphere: [ -73.99171, 40.738868 ], $maxDistance: 0.0036998565637149016 }});
// To get a list of all places (with distance in radians):
db.runCommand(
);
// This should include Maplewood, does not.
db.runCommand(
);
Venues:
geoDoc =
{"name" : '10gen Office', loc: [ -73.99171, 40.738868 ] }db.example.insert(geoDoc);
geoDoc =
{"name" : 'Maplewood, NJ', loc: [ -74.2713, 40.73137 ] }db.example.insert(geoDoc);
- related to
-
SERVER-2342 $within: {$center} vs. $near and $maxDistance
- Closed