Selaa lähdekoodia

ref #3286: Add Minkey and MaxKey support to ComparisonMatchExpression.js.

Brennan Chesley 12 vuotta sitten
vanhempi
commit
b840706fb8
1 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 4 3
      lib/pipeline/matcher/ComparisonMatchExpression.js

+ 4 - 3
lib/pipeline/matcher/ComparisonMatchExpression.js

@@ -1,8 +1,9 @@
 "use strict";
 
-var  LeafMatchExpression = require('./LeafMatchExpression');
+var LeafMatchExpression = require('./LeafMatchExpression');
 var Value = require('../Value');
 
+
 // Autogenerated by cport.py on 2013-09-17 14:37
 var ComparisonMatchExpression = module.exports = function ComparisonMatchExpression( type ){
 	this._matchType = type;
@@ -140,8 +141,8 @@ proto.matchesSingleElement = function matchesSingleElement( e ){ //  const BSONE
 		if ((e === null || e === undefined) && (this._rhs ===null || this._rhs === undefined)) {
 			return ["EQ","LTE","GTE"].indexOf(this._matchType) != -1;
 		}
-	
-		if (this._rhs instanceof MaxKey || this._rhs instanceof MinKey) {
+		
+		if (this._rhs.constructor.name in ['MaxKey','MinKey'] ) {
 			return this._matchType != "EQ";
 		}
 		return false;