| Steps To Reproduce: |
2.5.5-pre-
> db.c.insert({loc:{type:"Point",coordinates:[0,0]}})
|
Insert WriteResult({ "ok" : 1, "n" : 1 })
|
> db.c.insert({loc:{type:"Point",coordinates:[-1,0]}})
|
Insert WriteResult({ "ok" : 1, "n" : 1 })
|
> db.c.ensureIndex({loc:"2dsphere"})
|
> db.c.find({loc:{$nearSphere:{$geometry:{type:"Point",coordinates:[180,0]},$maxDistance:10e1000000}}})
|
{ "_id" : ObjectId("528fa9b06ce2fec2710a135b"), "loc" : { "type" : "Point", "coordinates" : [ -1, 0 ] } }
|
> db.c.find({loc:{$near:{$geometry:{type:"Point",coordinates:[180,0]},$maxDistance:10e1000000}}})
|
{ "_id" : ObjectId("528fa9b06ce2fec2710a135b"), "loc" : { "type" : "Point", "coordinates" : [ -1, 0 ] } }
|
> db.runCommand({geoNear:"c", near:{type:"Point",coordinates:[180,0]},spherical:true})
|
{
|
"ns" : "georepro.c",
|
"results" : [
|
{
|
"dis" : 19926073.25883961,
|
"obj" : {
|
"_id" : ObjectId("528fa9b06ce2fec2710a135b"),
|
"loc" : {
|
"type" : "Point",
|
"coordinates" : [
|
-1,
|
0
|
]
|
}
|
}
|
}
|
],
|
"stats" : {
|
"nscanned" : 2,
|
"avgDistance" : 19926073.25883961,
|
"maxDistance" : 19926073.25883961,
|
"time" : 7
|
},
|
"ok" : 1
|
}
|
2.4.9-pre-
> db.c.insert({loc:{type:"Point",coordinates:[0,0]}})
|
> db.c.insert({loc:{type:"Point",coordinates:[-1,0]}})
|
> db.c.ensureIndex({loc:"2dsphere"})
|
> db.c.find({loc:{$nearSphere:{$geometry:{type:"Point",coordinates:[180,0]},$maxDistance:10e1000000}}})
|
{ "_id" : ObjectId("528fa9b05142cd7d1e23d1bb"), "loc" : { "type" : "Point", "coordinates" : [ -1, 0 ] } }
|
{ "_id" : ObjectId("528fa99e5142cd7d1e23d1ba"), "loc" : { "type" : "Point", "coordinates" : [ 0, 0 ] } }
|
> db.c.find({loc:{$near:{$geometry:{type:"Point",coordinates:[180,0]},$maxDistance:10e1000000}}})
|
{ "_id" : ObjectId("528fa9b05142cd7d1e23d1bb"), "loc" : { "type" : "Point", "coordinates" : [ -1, 0 ] } }
|
{ "_id" : ObjectId("528fa99e5142cd7d1e23d1ba"), "loc" : { "type" : "Point", "coordinates" : [ 0, 0 ] } }
|
> db.runCommand({geoNear:"c", near:{type:"Point",coordinates:[180,0]},spherical:true})
|
{
|
"ns" : "georepro.c",
|
"results" : [
|
{
|
"dis" : 19926073.261345826,
|
"obj" : {
|
"_id" : ObjectId("528fa9b05142cd7d1e23d1bb"),
|
"loc" : {
|
"type" : "Point",
|
"coordinates" : [
|
-1,
|
0
|
]
|
}
|
}
|
},
|
{
|
"dis" : 20037392.09826071,
|
"obj" : {
|
"_id" : ObjectId("528fa99e5142cd7d1e23d1ba"),
|
"loc" : {
|
"type" : "Point",
|
"coordinates" : [
|
0,
|
0
|
]
|
}
|
}
|
}
|
],
|
"stats" : {
|
"time" : 5,
|
"nscanned" : 2,
|
"avgDistance" : 19981732.679803267,
|
"maxDistance" : 20037392.09826071
|
},
|
"ok" : 1
|
}
|
|