Skip to content

Commit 21e73ac

Browse files
committed
Destructuring
1 parent 957b592 commit 21e73ac

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,13 @@ export function transformKeyValue(schema, className, restKey, restValue, {
187187
// restWhere is the "where" clause in REST API form.
188188
// Returns the mongo form of the query.
189189
// Throws a Parse.Error if the input query is invalid.
190-
function transformWhere(schema, className, restWhere, options = {validate: true}) {
190+
function transformWhere(schema, className, restWhere, { validate = true } = {}) {
191191
let mongoWhere = {};
192192
if (restWhere['ACL']) {
193193
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Cannot query on ACL.');
194194
}
195-
let transformKeyOptions = {query: true};
196-
transformKeyOptions.validate = options.validate;
197195
for (let restKey in restWhere) {
198-
let out = transformKeyValue(schema, className, restKey, restWhere[restKey], transformKeyOptions);
196+
let out = transformKeyValue(schema, className, restKey, restWhere[restKey], { query: true, validate });
199197
mongoWhere[out.key] = out.value;
200198
}
201199
return mongoWhere;

0 commit comments

Comments
 (0)