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:
@@ -1,6 +1,7 @@
|
||||
import MongoCollection from './MongoCollection';
|
||||
import MongoSchemaCollection from './MongoSchemaCollection';
|
||||
import {parse as parseUrl, format as formatUrl} from '../../../vendor/mongodbUrl';
|
||||
import * as transform from './MongoTransform';
|
||||
import _ from 'lodash';
|
||||
|
||||
let mongodb = require('mongodb');
|
||||
@@ -57,7 +58,7 @@ export class MongoStorageAdapter {
|
||||
|
||||
schemaCollection() {
|
||||
return this.connect()
|
||||
.then(() => this.adaptiveCollection(this._collectionPrefix + MongoSchemaCollectionName))
|
||||
.then(() => this.adaptiveCollection(MongoSchemaCollectionName))
|
||||
.then(collection => new MongoSchemaCollection(collection));
|
||||
}
|
||||
|
||||
@@ -125,6 +126,10 @@ export class MongoStorageAdapter {
|
||||
.then(updateResult => this.schemaCollection())
|
||||
.then(schemaCollection => schemaCollection.updateSchema(className, schemaUpdate));
|
||||
}
|
||||
|
||||
get transform() {
|
||||
return transform;
|
||||
}
|
||||
}
|
||||
|
||||
export default MongoStorageAdapter;
|
||||
|
||||
Reference in New Issue
Block a user