diff --git a/src/Adapters/Storage/Mongo/MongoStorageAdapter.js b/src/Adapters/Storage/Mongo/MongoStorageAdapter.js index 6082952f..b24ed6b9 100644 --- a/src/Adapters/Storage/Mongo/MongoStorageAdapter.js +++ b/src/Adapters/Storage/Mongo/MongoStorageAdapter.js @@ -201,7 +201,7 @@ export class MongoStorageAdapter { // undefined as the reason. getClass(className) { return this._schemaCollection() - .then(schemasCollection => schemasCollection._fechOneSchemaFrom_SCHEMA(className)); + .then(schemasCollection => schemasCollection._fechOneSchemaFrom_SCHEMA(className)) } // TODO: As yet not particularly well specified. Creates an object. Maybe shouldn't even need the schema, diff --git a/src/Controllers/DatabaseController.js b/src/Controllers/DatabaseController.js index 65bea913..9e3c6e38 100644 --- a/src/Controllers/DatabaseController.js +++ b/src/Controllers/DatabaseController.js @@ -100,12 +100,8 @@ DatabaseController.prototype.collectionExists = function(className) { DatabaseController.prototype.purgeCollection = function(className) { return this.loadSchema() - .then((schema) => { - schema.getOneSchema(className) - }) - .then((schema) => { - this.adapter.deleteObjectsByQuery(className, {}, schema); - }); + .then(schemaController => schemaController.getOneSchema(className)) + .then(schema => this.adapter.deleteObjectsByQuery(className, schema, {})); }; DatabaseController.prototype.validateClassName = function(className) {