|
|
@@ -177,7 +177,7 @@ proto._parseAll = function _parseAll(name, element){
|
|
|
return {code:ErrorCodes.BAD_VALUE, description:"$all needs an array"};
|
|
|
|
|
|
var arr = element;
|
|
|
- if ((arr[0] instanceof Object) && ("$elemMatch" == arr[0].keys()[0])) {
|
|
|
+ if ((arr[0] instanceof Object) && ("$elemMatch" == Object.keys(arr[0])[0])) {
|
|
|
// $all : [ { $elemMatch : {} } ... ]
|
|
|
|
|
|
var temp = new AllElemMatchOp();
|
|
|
@@ -218,7 +218,7 @@ proto._parseAll = function _parseAll(name, element){
|
|
|
return status;
|
|
|
myAnd.add(r);
|
|
|
}
|
|
|
- else if ((e instanceof Object) && (e.keys()[0].getGtLtOp(-1) != -1)) {
|
|
|
+ else if ((e instanceof Object) && (typeof(Object.keys(e)[0] == 'string' && Object.keys(e)[0][0] == '$' ))) {
|
|
|
return {code:ErrorCodes.BAD_VALUE, description:"no $ expressions in $all"};
|
|
|
}
|
|
|
else {
|
|
|
@@ -237,6 +237,9 @@ proto._parseAll = function _parseAll(name, element){
|
|
|
return {code:ErrorCodes.OK, result:myAnd};
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* This documentation was automatically generated. Please update when you touch this function.
|
|
|
@@ -520,7 +523,7 @@ proto._parseSub = function _parseSub(name, sub, root){
|
|
|
root.add(status.result);
|
|
|
}
|
|
|
|
|
|
- return {code:ErrorCodes.OK};
|
|
|
+ return {code:ErrorCodes.OK, result:root};
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
@@ -656,10 +659,10 @@ proto._parseSubField = function _parseSubField(context, andSoFar, name, element)
|
|
|
return this._parseRegexDocument(name, context);
|
|
|
|
|
|
case '$elemMatch':
|
|
|
- return this._parseElemMatch(name, element);
|
|
|
+ return this._parseElemMatch(name, currval);
|
|
|
|
|
|
case '$all':
|
|
|
- return this._parseAll(name, element);
|
|
|
+ return this._parseAll(name, currval);
|
|
|
|
|
|
case '$geoWithin':
|
|
|
case '$geoIntersects':
|