From 21e73ac276d1d2fbd5642d98b56e55016e780a87 Mon Sep 17 00:00:00 2001 From: Drew Gross Date: Mon, 25 Apr 2016 17:21:24 -0700 Subject: [PATCH] Destructuring --- src/Adapters/Storage/Mongo/MongoTransform.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Adapters/Storage/Mongo/MongoTransform.js b/src/Adapters/Storage/Mongo/MongoTransform.js index 34f0f157..87ef89b0 100644 --- a/src/Adapters/Storage/Mongo/MongoTransform.js +++ b/src/Adapters/Storage/Mongo/MongoTransform.js @@ -187,15 +187,13 @@ export function transformKeyValue(schema, className, restKey, restValue, { // restWhere is the "where" clause in REST API form. // Returns the mongo form of the query. // Throws a Parse.Error if the input query is invalid. -function transformWhere(schema, className, restWhere, options = {validate: true}) { +function transformWhere(schema, className, restWhere, { validate = true } = {}) { let mongoWhere = {}; if (restWhere['ACL']) { throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Cannot query on ACL.'); } - let transformKeyOptions = {query: true}; - transformKeyOptions.validate = options.validate; for (let restKey in restWhere) { - let out = transformKeyValue(schema, className, restKey, restWhere[restKey], transformKeyOptions); + let out = transformKeyValue(schema, className, restKey, restWhere[restKey], { query: true, validate }); mongoWhere[out.key] = out.value; } return mongoWhere;