diff --git a/src/Adapters/Storage/Mongo/MongoTransform.js b/src/Adapters/Storage/Mongo/MongoTransform.js index 95c5fee5..7526c9cb 100644 --- a/src/Adapters/Storage/Mongo/MongoTransform.js +++ b/src/Adapters/Storage/Mongo/MongoTransform.js @@ -130,12 +130,7 @@ function transformKeyValue(schema, className, restKey, restValue, { return {key: key, value: value}; } -function transformQueryKeyValue(schema, className, restKey, restValue, { - inArray, - inObject, - update, - validate, -} = {}) { +function transformQueryKeyValue(schema, className, restKey, restValue, { validate } = {}) { // Check if the schema is known since it's a built-in field. var key = restKey; var timeField = false; @@ -228,7 +223,7 @@ function transformQueryKeyValue(schema, className, restKey, restValue, { } // Handle atomic values - var value = transformAtom(restValue, false, { inArray, inObject }); + var value = transformAtom(restValue, false); if (value !== CannotTransform) { if (timeField && (typeof value === 'string')) { value = new Date(value); @@ -236,19 +231,13 @@ function transformQueryKeyValue(schema, className, restKey, restValue, { return {key: key, value: value}; } - // ACLs are handled before this method is called - // If an ACL key still exists here, something is wrong. - if (key === 'ACL') { - throw 'There was a problem transforming an ACL.'; - } - // Handle arrays if (restValue instanceof Array) { throw new Parse.Error(Parse.Error.INVALID_JSON,'cannot use array as query param'); } // Handle update operators - value = transformUpdateOperator(restValue, !update); + value = transformUpdateOperator(restValue, true); if (value !== CannotTransform) { return {key: key, value: value}; }