summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorQingyang Chen <qingyang.chen@10gen.com>2015-06-10 13:52:38 -0400
committerQingyang Chen <qingyang.chen@10gen.com>2015-07-14 14:16:40 -0400
commit8d34c171bb7d636c479d508937fe748377afc55a (patch)
treeeaaa83dd40aee203487a79277bc9f809b5afa3c0 /src/mongo/bson
parent2f631e87fc531b905605dc93f4d1a0dab26e28f9 (diff)
downloadmongo-8d34c171bb7d636c479d508937fe748377afc55a.tar.gz
SERVER-3518 Bit test query operators
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/bsonelement.cpp9
-rw-r--r--src/mongo/bson/bsonobj.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/bson/bsonelement.cpp b/src/mongo/bson/bsonelement.cpp
index 72d104b15d6..b44099b56ce 100644
--- a/src/mongo/bson/bsonelement.cpp
+++ b/src/mongo/bson/bsonelement.cpp
@@ -340,6 +340,15 @@ int BSONElement::getGtLtOp(int def) const {
return BSONObj::opNEAR;
else if (str::equals(fn + 1, "geoWithin"))
return BSONObj::opWITHIN;
+ else if (str::equals(fn + 1, "bitsAllSet")) {
+ return BSONObj::opBITS_ALL_SET;
+ } else if (str::equals(fn + 1, "bitsAllClear")) {
+ return BSONObj::opBITS_ALL_CLEAR;
+ } else if (str::equals(fn + 1, "bitsAnySet")) {
+ return BSONObj::opBITS_ANY_SET;
+ } else if (str::equals(fn + 1, "bitsAnyClear")) {
+ return BSONObj::opBITS_ANY_CLEAR;
+ }
}
return def;
}
diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h
index 466ee1521f1..bcce522da75 100644
--- a/src/mongo/bson/bsonobj.h
+++ b/src/mongo/bson/bsonobj.h
@@ -520,6 +520,10 @@ public:
opWITHIN = 0x14,
opMAX_DISTANCE = 0x15,
opGEO_INTERSECTS = 0x16,
+ opBITS_ALL_SET = 0x17,
+ opBITS_ALL_CLEAR = 0x18,
+ opBITS_ANY_SET = 0x19,
+ opBITS_ANY_CLEAR = 0x1A,
};
/** add all elements of the object to the specified vector */