summaryrefslogtreecommitdiff
path: root/db/matcher.h
diff options
context:
space:
mode:
authorU-tellus\cwestin <cwestin@10gen.com>2011-10-12 16:56:11 -0700
committerU-tellus\cwestin <cwestin@10gen.com>2011-10-12 16:56:11 -0700
commita40e2b03b4f7f4833b07e8575b16479093372a64 (patch)
treec6443e4a3ac6cf7ebc5a42eef23637196b06815c /db/matcher.h
parentdbdcf96cc9c772ea8cd089103cbb88e2e7d7e20e (diff)
parentc5e9162870e1fbf060ba5b20cb57e13ae9fff877 (diff)
downloadmongo-a40e2b03b4f7f4833b07e8575b16479093372a64.tar.gz
merge from head
Diffstat (limited to 'db/matcher.h')
-rw-r--r--db/matcher.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/db/matcher.h b/db/matcher.h
index 17383fe441e..440d770ae12 100644
--- a/db/matcher.h
+++ b/db/matcher.h
@@ -62,7 +62,11 @@ namespace mongo {
ElementMatcher( BSONElement e , int op , const BSONObj& array, bool isNot );
~ElementMatcher() { }
-
+
+ bool negativeCompareOp() const { return _compareOp == BSONObj::NE || _compareOp == BSONObj::NIN; }
+ int inverseOfNegativeCompareOp() const;
+ bool negativeCompareOpContainsNull() const;
+
BSONElement _toMatch;
int _compareOp;
bool _isNot;
@@ -124,7 +128,11 @@ namespace mongo {
const BSONElement& toMatch, const BSONObj& obj,
int compareOp, const ElementMatcher& bm, bool isArr , MatchDetails * details ) const;
- int matchesNe(
+ /**
+ * Perform a NE or NIN match by returning the inverse of the opposite matching operation.
+ * Missing values are considered matches unless the match must not equal null.
+ */
+ int inverseMatch(
const char *fieldName,
const BSONElement &toMatch, const BSONObj &obj,
const ElementMatcher&bm, MatchDetails * details ) const;
@@ -192,6 +200,7 @@ namespace mongo {
bool parseClause( const BSONElement &e );
void parseExtractedClause( const BSONElement &e, list< shared_ptr< Matcher > > &matchers );
+ void parseWhere( const BSONElement &e );
void parseMatchExpressionElement( const BSONElement &e, bool nested );
Where *_where; // set if query uses $where