Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-7802 rename s2d to 2dsphere

  • Loading branch information...
commit 7e0732e4dbdd9bc2b16dfca704b39987f47a1f5d 1 parent e76eda3
Hari Khalsa authored
View
4 jstests/geo_s2index.js
@@ -24,7 +24,7 @@ t.insert( {geo : pointE} )
somepoly = { "type" : "Polygon",
"coordinates" : [ [ [40,5], [40,6], [41,6], [41,5], [40,5]]]}
t.insert( {geo : somepoly, nonGeo: ["somepoly"] })
-t.ensureIndex( { geo : "s2d", nonGeo: 1 } )
+t.ensureIndex( { geo : "2dsphere", nonGeo: 1 } )
res = t.find({ "geo" : { "$intersect" : { "$geometry" : pointA} } });
assert.eq(res.count(), 3);
@@ -50,7 +50,7 @@ assert.eq(res.count(), 1);
// Don't crash mongod if we give it bad input.
t.drop()
-t.ensureIndex({loc: "s2d", x:1})
+t.ensureIndex({loc: "2dsphere", x:1})
t.save({loc: [0,0]})
assert.throws(function() { return t.count({loc: {$foo:[0,0]}}) })
assert.throws(function() { return t.find({ "nonGeo": "pointA",
View
2  jstests/geo_s2near.js
@@ -15,7 +15,7 @@ for (var x = -points; x < points; x += 1) {
origin = { "type" : "Point", "coordinates": [ lng, lat ] }
-t.ensureIndex({ geo : "s2d" })
+t.ensureIndex({ geo : "2dsphere" })
res = t.find({ "geo" : { "$near" : { "$geometry" : origin, $maxDistance: 2000} } }).limit(10)
assert.eq(res.itcount(), 10)
View
2  jstests/geo_s2nopoints.js
@@ -2,6 +2,6 @@
t = db.geo_s2nopoints
t.drop()
-t.ensureIndex({loc: "s2d", x:1})
+t.ensureIndex({loc: "2dsphere", x:1})
assert.eq(0, t.count({loc: {$near: {$geometry: {type: 'Point', coordinates:[0,0]},
$maxDistance: 10}}}))
View
2  src/mongo/db/geo/s2index.cpp
@@ -42,7 +42,7 @@ namespace {
namespace mongo {
- static const string SPHERE_2D_NAME = "s2d";
+ static const string SPHERE_2D_NAME = "2dsphere";
class GeoSphere2DType : public IndexType {
public:
View
4 src/mongo/db/queryutil.cpp
@@ -450,10 +450,10 @@ namespace mongo {
break;
case BSONObj::opNEAR:
_special.insert("2d");
- _special.insert("s2d");
+ _special.insert("2dsphere");
break;
case BSONObj::opINTERSECT:
- _special.insert("s2d");
+ _special.insert("2dsphere");
break;
case BSONObj::opEXISTS: {
if ( !existsSpec ) {
View
2  src/mongo/s/chunk.cpp
@@ -1081,7 +1081,7 @@ namespace mongo {
OrRangeGenerator org(_ns.c_str(), query, false);
const set<string> special = org.getSpecial();
- if (special.end() != special.find("2d") || special.end() != special.find("s2d")) {
+ if (special.end() != special.find("2d") || special.end() != special.find("2dsphere")) {
BSONForEach(field, query) {
if (getGtLtOp(field) == BSONObj::opNEAR) {
uassert(13501, "use geoNear command rather than $near query", false);
Please sign in to comment.
Something went wrong with that request. Please try again.