DBController refactoring (#1228)

* Moves transform to MongoTransform

- Adds ACL query injection in MongoTransform

* Removes adaptiveCollection from DatabaseController

- All collections manipulations are now handled by a DBController
- Adds optional flags to configure an unsafe databaseController for direct
  access
- Adds ability to configure RestWrite with multiple writes
- Moves some transfirmations to MongoTransform as they output specific code

* Renames Unsafe to WithoutValidation
This commit is contained in:
Florent Vilmart
2016-04-14 19:24:56 -04:00
parent 51970fb470
commit 1023baf20d
17 changed files with 317 additions and 291 deletions

View File

@@ -15,7 +15,6 @@
// TODO: hide all schema logic inside the database adapter.
const Parse = require('parse/node').Parse;
const transform = require('./transform');
import MongoSchemaCollection from './Adapters/Storage/Mongo/MongoSchemaCollection';
import _ from 'lodash';
@@ -429,7 +428,7 @@ class Schema {
validateField(className, fieldName, type, freeze) {
return this.reloadData().then(() => {
// Just to check that the fieldName is valid
transform.transformKey(this, className, fieldName);
this._collection.transform.transformKey(this, className, fieldName);
if( fieldName.indexOf(".") > 0 ) {
// subdocument key (x.y) => ok if x is of type 'object'