|
|
@ -622,7 +622,20 @@ comparisonFunctions.$size = function (obj, value) { |
|
|
|
|
|
|
|
|
|
|
|
return (obj.length == value); |
|
|
|
return (obj.length == value); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
comparisonFunctions.$elemMatch = function(obj,value){ |
|
|
|
|
|
|
|
if (!util.isArray(obj)) { return false; } |
|
|
|
|
|
|
|
var i = obj.length; |
|
|
|
|
|
|
|
var result = false; // Initialize result
|
|
|
|
|
|
|
|
while(i--){ |
|
|
|
|
|
|
|
if (match(obj[i],value)){ // If match for array element, return true
|
|
|
|
|
|
|
|
result = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
}; |
|
|
|
arrayComparisonFunctions.$size = true; |
|
|
|
arrayComparisonFunctions.$size = true; |
|
|
|
|
|
|
|
arrayComparisonFunctions.$elemMatch = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|