Move more mongo specific stuff into mongo adapter
This commit is contained in:
@@ -200,8 +200,9 @@ export class MongoStorageAdapter {
|
||||
// Executes a find. Accepts: className, query in Parse format, and { skip, limit, sort }.
|
||||
find(className, query, schema, { skip, limit, sort }) {
|
||||
let mongoWhere = this.transform.transformWhere(className, query, schema);
|
||||
let mongoSort = _.mapKeys(sort, (value, fieldName) => transform.transformKey(className, fieldName, schema));
|
||||
return this.adaptiveCollection(className)
|
||||
.then(collection => collection.find(mongoWhere, { skip, limit, sort }))
|
||||
.then(collection => collection.find(mongoWhere, { skip, limit, sort: mongoSort }))
|
||||
.then(objects => objects.map(object => transform.mongoObjectToParseObject(className, object, schema)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user