Skip to content

Commit 5c7b346

Browse files
committed
Remove unnecessary logic
1 parent e0a9f19 commit 5c7b346

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,7 @@ function transformKeyValue(schema, className, restKey, restValue, {
130130
return {key: key, value: value};
131131
}
132132

133-
function transformQueryKeyValue(schema, className, restKey, restValue, {
134-
inArray,
135-
inObject,
136-
update,
137-
validate,
138-
} = {}) {
133+
function transformQueryKeyValue(schema, className, restKey, restValue, { validate } = {}) {
139134
// Check if the schema is known since it's a built-in field.
140135
var key = restKey;
141136
var timeField = false;
@@ -228,27 +223,21 @@ function transformQueryKeyValue(schema, className, restKey, restValue, {
228223
}
229224

230225
// Handle atomic values
231-
var value = transformAtom(restValue, false, { inArray, inObject });
226+
var value = transformAtom(restValue, false);
232227
if (value !== CannotTransform) {
233228
if (timeField && (typeof value === 'string')) {
234229
value = new Date(value);
235230
}
236231
return {key: key, value: value};
237232
}
238233

239-
// ACLs are handled before this method is called
240-
// If an ACL key still exists here, something is wrong.
241-
if (key === 'ACL') {
242-
throw 'There was a problem transforming an ACL.';
243-
}
244-
245234
// Handle arrays
246235
if (restValue instanceof Array) {
247236
throw new Parse.Error(Parse.Error.INVALID_JSON,'cannot use array as query param');
248237
}
249238

250239
// Handle update operators
251-
value = transformUpdateOperator(restValue, !update);
240+
value = transformUpdateOperator(restValue, true);
252241
if (value !== CannotTransform) {
253242
return {key: key, value: value};
254243
}

0 commit comments

Comments
 (0)