Skip to content

Commit 87793e6

Browse files
committed
Fix nits
1 parent 3379866 commit 87793e6

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Adapters/Storage/Mongo/MongoTransform.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ var Parse = require('parse/node').Parse;
1515
// in the value are converted to a mongo update form. Otherwise they are
1616
// converted to static data.
1717
//
18-
// validate: true indicates that key names are to be validated.
19-
//
2018
// Returns an object with {key: key, value: value}.
2119
function transformKeyValue(schema, className, restKey, restValue, {
2220
inArray,
2321
inObject,
2422
update,
25-
validate,
2623
} = {}) {
2724
// Check if the schema is known since it's a built-in field.
2825
var key = restKey;

src/Controllers/DatabaseController.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,16 +624,15 @@ DatabaseController.prototype.find = function(className, query, {
624624
if (fieldName === '_created_at') {
625625
fieldName = 'createdAt';
626626
sort['createdAt'] = sort['_created_at'];
627-
}
628-
if (fieldName === '_updated_at') {
627+
} else if (fieldName === '_updated_at') {
629628
fieldName = 'updatedAt';
630629
sort['updatedAt'] = sort['_updated_at'];
631630
}
632631

633632
if (!SchemaController.fieldNameIsValid(fieldName)) {
634633
throw new Parse.Error(Parse.Error.INVALID_KEY_NAME, `Invalid field name: ${fieldName}.`);
635634
}
636-
let mongoKey = this.transform.transformKeyValue(schemaController, className, fieldName, null).key;
635+
const mongoKey = this.transform.transformKeyValue(schemaController, className, fieldName, null).key;
637636
mongoOptions.sort[mongoKey] = sort[fieldName];
638637
}
639638
}

0 commit comments

Comments
 (0)