summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorQingyang Chen <qingyang.chen@10gen.com>2015-08-04 17:18:00 -0400
committerQingyang Chen <qingyang.chen@10gen.com>2015-08-06 13:30:36 -0400
commit826bdb4c161faf9ac28592cb5b70554251a2dc86 (patch)
tree589643e598efc2eceab05e16ba3f0d99e8c9c078 /src/mongo/bson
parent2830b503d24bd33077a4161e60ad4727972d5508 (diff)
downloadmongo-826bdb4c161faf9ac28592cb5b70554251a2dc86.tar.gz
SERVER-19713 $maxDistance should not be able to take a BSONObj
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/bsonelement.cpp8
-rw-r--r--src/mongo/bson/bsonobj.h1
2 files changed, 1 insertions, 8 deletions
diff --git a/src/mongo/bson/bsonelement.cpp b/src/mongo/bson/bsonelement.cpp
index 8373a9c0232..72be6da4d62 100644
--- a/src/mongo/bson/bsonelement.cpp
+++ b/src/mongo/bson/bsonelement.cpp
@@ -303,10 +303,10 @@ const StringMap<BSONObj::MatchType> queryOperatorMap{
{"options", BSONObj::opOPTIONS},
{"elemMatch", BSONObj::opELEM_MATCH},
{"near", BSONObj::opNEAR},
+ {"nearSphere", BSONObj::opNEAR},
{"geoNear", BSONObj::opNEAR},
{"within", BSONObj::opWITHIN},
{"geoWithin", BSONObj::opWITHIN},
- {"maxDistance", BSONObj::opMAX_DISTANCE},
{"geoIntersects", BSONObj::opGEO_INTERSECTS},
{"bitsAllSet", BSONObj::opBITS_ALL_SET},
{"bitsAllClear", BSONObj::opBITS_ALL_CLEAR},
@@ -323,12 +323,6 @@ int BSONElement::getGtLtOp(int def) const {
StringMap<BSONObj::MatchType>::const_iterator queryOp = queryOperatorMap.find(opName);
if (queryOp == queryOperatorMap.end()) {
- // Need to handle $near separately because anything starting with $near should map to
- // BSONObj::opNEAR.
- if ("near" == opName.substr(0, 4)) {
- return BSONObj::opNEAR;
- }
-
return def;
}
return queryOp->second;
diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h
index bcce522da75..b7d32dbda5f 100644
--- a/src/mongo/bson/bsonobj.h
+++ b/src/mongo/bson/bsonobj.h
@@ -518,7 +518,6 @@ public:
opELEM_MATCH = 0x12,
opNEAR = 0x13,
opWITHIN = 0x14,
- opMAX_DISTANCE = 0x15,
opGEO_INTERSECTS = 0x16,
opBITS_ALL_SET = 0x17,
opBITS_ALL_CLEAR = 0x18,