Show
Create a collection containing those two documents:
{ "_id" : 1, "geometry" : { "type" : "Polygon", "coordinates" : [ [ [ 2.119381, 41.33061 ], [ -174.006166, -90 ], [ -180, -90 ], [ -180, -8.695196 ], [ -2.19644, 40.196647 ], [ 2.119957, 41.335644 ], [ 2.120312, 41.333592 ], [ 2.119381, 41.33061 ] ] ] }, "type" : "Feature", "properties" : { } }
{ "_id" : 2, "geometry" : { "type" : "Polygon", "coordinates" : [ [ [ 2.12758, 41.323953 ], [ 2.110699, 41.113954 ], [ -12.960389, -90 ], [ -174.006166, -90 ], [ 2.119381, 41.33061 ], [ 2.12758, 41.323953 ] ] ] }, "type" : "Feature", "properties" : { } }
The following query should return doc 2, but instead returns nothing:
db.collection.find({"geometry":{$geoIntersects:{$geometry:{"type":"Point", "coordinates":[2.12127,41.32236]}}}})
The following query should return doc 2, but instead returns doc 1:
db.collection.find({"geometry":{$geoIntersects:{$geometry:{"type":"Point", "coordinates":[2.10154,41.29387]}}}})