Kaynağa Gözat

Refs #3359. All MatchDocumentSource test cases now pass. We need more.

Spencer Rathbun 12 yıl önce
ebeveyn
işleme
38e095049c

+ 1 - 1
lib/pipeline/matcher/ArrayFilterEntries.js

@@ -90,7 +90,7 @@ proto.addRegex = function addRegex( expr ) { //  RegexMatchExpression* expr
 proto.contains = function contains( elem ) { //  const BSONElement& elem
 // File: expression_leaf.h lines: 249-248
 	for (var i = 0; i < this._equalities.length; i++) {
-		if( Value.compare(elem, this._equalities[i])) {
+		if(Value.compare(elem, this._equalities[i]) === 0) {
 			return true;
 		}
 	}

+ 2 - 2
lib/pipeline/matcher/InMatchExpression.js

@@ -16,7 +16,7 @@ var errors = require("../../Errors.js"),
 // File: expression_leaf.h lines: 294-294
 //         ArrayFilterEntries _arrayEntries;
 
-proto._arrayEntries = undefined;
+proto._arrayEntries = null;
 
 /**
  *
@@ -27,7 +27,7 @@ proto._arrayEntries = undefined;
  */
 proto._matchesRealElement = function _matchesRealElement( e ) { //  const BSONElement& e
 // File: expression_leaf.cpp lines: 422-431
-	if( e in this._arrayEntries ) {
+	if(this._arrayEntries.contains(e)) { // array wrapper.... so no e "in" array
 		return true;
 	}
 

+ 3 - 3
lib/pipeline/matcher/LeafMatchExpression.js

@@ -23,7 +23,7 @@ proto._path = undefined;
 
 
 /**
- * 
+ *
  * This documentation was automatically generated. Please update when you touch this function.
  * @method initPath
  * @param
@@ -40,7 +40,7 @@ proto.initPath = function initPath( path ) { //  const StringData& path
 
 
 /**
- * 
+ *
  * This documentation was automatically generated. Please update when you touch this function.
  * @method matches
  * @param
@@ -68,7 +68,7 @@ proto.matches = function matches( doc, details ) { //  const MatchableDocument*
 
 
 /**
- * 
+ *
  * This documentation was automatically generated. Please update when you touch this function.
  * @method path
  * @param