Doing a $geoWithin query on a point at the pole returns results in 2.5.5-pre, but not if a 2dsphere index is raised.
2.5.5-pre:
> db.repro.insert("loc" : [ 25, 90 ])
SingleWriteResult({
"writeErrors" : [ ],
"writeConcernErrors" : [ ],
"nInserted" : 1,
"nUpserted" : 0,
"nUpdated" : 0,
"nModified" : 0,
"nRemoved" : 0,
"upserted" : [ ]
})
> db.repro.find({loc: {$geoWithin: {$geometry: {type: "Polygon", coordinates: [[[180,90], [180,0], [0,0], [180,90]]]}}}})
{ "_id" : 0, "loc" : { "type" : "Point", "coordinates" : [ 25, 90 ] } }
>
> db.repro.ensureIndex({loc:"2dsphere"})
> db.repro.find({loc: {$geoWithin: {$geometry: {type: "Polygon", coordinates: [[[180,90], [180,0], [0,0], [180,90]]]}}}})
> db.repro.dropIndexes()
> db.repro.ensureIndex({loc:"2d"})
> db.repro.find({loc: {$geoWithin: {$geometry: {type: "Polygon", coordinates: [[[180,90], [180,0], [0,0], [180,90]]]}}}})
{ "_id" : 0, "loc" : { "type" : "Point", "coordinates" : [ 25, 90 ] } }
> db.runCommand({"buildinfo":1}).gitVersion
f65a0b814b8c77e3fbe90bca0c061c9b77f6acdb
Separately, in 2.4.9, the document is not found at all:
> mydb.repro.insert(x)
> mydb.repro.find({loc: {$geoWithin: {$geometry: {type: "Polygon", coordinates: [[[180,90], [180,0], [0,0], [180,90]]]}}}})
>
- duplicates
-
SERVER-13599 $geoIntersects does not return polygon with shared edge
-
- Backlog
-