|
|
|
@ -13,7 +13,7 @@ var dateToJSON = function () { return { $$date: this.getTime() }; } |
|
|
|
|
, lastStepModifierFunctions = {} |
|
|
|
|
, comparisonFunctions = {} |
|
|
|
|
, 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 (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]; }); |
|
|
|
|
dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; }); |
|
|
|
|
|
|
|
|
|
if (keys.length == 1 && dollarFirstChars.length > 0 && queryOperatorArray[keys[0]]) { |
|
|
|
|
if (!queryOperatorArray[keys[0]](objValue, queryValue[keys[0]])) { return false; } |
|
|
|
|
if (keys.length == 1 && dollarFirstChars.length > 0 && arrayComparisonFunctions[keys[0]]) { |
|
|
|
|
if (!arrayComparisonFunctions[keys[0]](objValue, queryValue[keys[0]])) { return false; } |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|