Compare:
> db.poiConcat.find( { ty: 1, l: { $geoWithin: { $centerSphere: [ [ -80.1745962, 26.148911 ], 50000000 ] } } } ).limit(1); { "_id" : "n99364450", "ty" : NumberLong(1), "l" : { "type" : "Point", "coordinates" : [ -80.3810378, 25.5883277 ] }, "ts" : [ "amenity=parking" ], "m" : { "v" : NumberLong(4), "cs" : NumberLong(18737061), "uid" : NumberLong(1795637), "ts" : NumberLong(1383685090) } }
> db.poiConcat.find( { ty: 2, l: { $geoWithin: { $centerSphere: [ [ -80.1745962, 26.148911 ], 500000 ] } } } ).limit(1);
With a distance of 500km, it should certainly find documents. The range below (1 degree) is much less (about 100km):
> > db.poiConcat.find( { ty: 2, l: { $geoWithin: { $geometry : { type: 'Polygon', coordinates : [ [ [ -80.1745962, 26.148911 ], [ -79, 26 ], [ -79, 25 ], [ -80, 25 ], [ -80.1745962, 26.148911 ] ] ] } } } } ).limit(1); { "_id" : "w414476448", "ty" : NumberLong(2), "l" : { "type" : "Polygon", "coordinates" : [ [ [ -80.1091137, 26.0908518 ], [ -80.1090739, 26.0907767 ], [ -80.1092148, 26.0907164 ], [ -80.1092547, 26.0907915 ], [ -80.1091137, 26.0908518 ] ] ] }, "ts" : [ "name=Jetty Pavilion", "amenity=shelter", "building=yes" ], "m" : { "v" : NumberLong(1), "cs" : NumberLong(38985825), "uid" : NumberLong(684651), "ts" : NumberLong(1461953735) } }
- is related to
-
COMPASS-237 Extend query building capabilities of maps
- Closed
- related to
-
SERVER-30390 Add support for $geoIntersects with geo operator $centerSphere
- Backlog