Move query logic into mongo (#1885)

* Move Parse Server logic into Parse Server and out of MongoAdapter

* Move untransforming up one level

* Make find() in MongoStorageAdapter

* Put nested object untransforming into it's own function

* Simplfy nested untransform

* Don't mess with inner object keys called _auth_data_*

* Prevent untransforming inner object keys named _p_*

* Fix inner keys named _rperm, _wperm

* Fix bugs with inner objects behaving strange when other fields have same name as key in specific circumstances

* remove params from untransform nested object

* Revert changes to find
This commit is contained in:
Drew
2016-05-23 16:31:51 -07:00
committed by Florent Vilmart
parent 88fa7bad92
commit 614e1ac8e5
6 changed files with 184 additions and 124 deletions

View File

@@ -197,6 +197,14 @@ export class MongoStorageAdapter {
});
}
// Executes a find. Accepts: className, query in Parse format, and { skip, limit, sort }.
// Accepts the schemaController for legacy reasons.
find(className, query, { skip, limit, sort }, schemaController) {
return this.adaptiveCollection(className)
.then(collection => collection.find(query, { skip, limit, sort }))
.then(objects => objects.map(object => transform.mongoObjectToParseObject(schemaController, className, object)));
}
get transform() {
return transform;
}