|
|
@ -13,7 +13,7 @@ var dateToJSON = function () { return { $$date: this.getTime() }; } |
|
|
|
, lastStepModifierFunctions = {} |
|
|
|
, lastStepModifierFunctions = {} |
|
|
|
, comparisonFunctions = {} |
|
|
|
, comparisonFunctions = {} |
|
|
|
, logicalOperators = {} |
|
|
|
, logicalOperators = {} |
|
|
|
, queryOperatorArray = {} |
|
|
|
, arrayComparisonFunctions = {} |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -584,7 +584,7 @@ comparisonFunctions.$exists = function (value, exists) { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
queryOperatorArray.$size = function (obj, value) { |
|
|
|
arrayComparisonFunctions.$size = function (obj, value) { |
|
|
|
if (!util.isArray(obj)) { return false; } |
|
|
|
if (!util.isArray(obj)) { return false; } |
|
|
|
if (value % 1 !== 0) { throw "$size operator called without an integer"; } |
|
|
|
if (value % 1 !== 0) { throw "$size operator called without an integer"; } |
|
|
|
|
|
|
|
|
|
|
@ -685,8 +685,8 @@ function matchQueryPart (obj, queryKey, queryValue) { |
|
|
|
firstChars = _.map(keys, function (item) { return item[0]; }); |
|
|
|
firstChars = _.map(keys, function (item) { return item[0]; }); |
|
|
|
dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; }); |
|
|
|
dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; }); |
|
|
|
|
|
|
|
|
|
|
|
if (keys.length == 1 && dollarFirstChars.length > 0 && queryOperatorArray[keys[0]]) { |
|
|
|
if (keys.length == 1 && dollarFirstChars.length > 0 && arrayComparisonFunctions[keys[0]]) { |
|
|
|
if (!queryOperatorArray[keys[0]](objValue, queryValue[keys[0]])) { return false; } |
|
|
|
if (!arrayComparisonFunctions[keys[0]](objValue, queryValue[keys[0]])) { return false; } |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|