Given 3 points:
{ "_id" : "1", "name" : "b", "loc" : { "coordinates" : [ -121, 47.134296 ], "type" : "Point" }, "description" : ""} { "_id" : "2", "name" : "a", "loc" : { "coordinates" : [ -120, 47.234296 ], "type" : "Point" }, "description" : ""} { "_id" : "3", "name" : "c", "loc" : { "coordinates" : [ -125, 49.134296 ], "type" : "Point" }, "description" : ""}
The following query returns 2 results - first 2 objects (with id-s 1 and 2 ) even though their latitude lays outside of given polygon.
db.SimpleVisits.find( { "loc" : { "$geoWithin" : { "$geometry" : { "type" : "Polygon" , "coordinates" : [ [ [ -100.0 , 46.5] , [ -130.0 , 46.5] , [ -130.0 , 40.01] , [ -100.0 , 40.01] , [ -100.0 , 46.5]]]}}}})
- related to
-
SERVER-15609 GeoWithin query returns wrong result
- Closed