Fix purge
This commit is contained in:
@@ -201,7 +201,7 @@ export class MongoStorageAdapter {
|
|||||||
// undefined as the reason.
|
// undefined as the reason.
|
||||||
getClass(className) {
|
getClass(className) {
|
||||||
return this._schemaCollection()
|
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,
|
// TODO: As yet not particularly well specified. Creates an object. Maybe shouldn't even need the schema,
|
||||||
|
|||||||
@@ -100,12 +100,8 @@ DatabaseController.prototype.collectionExists = function(className) {
|
|||||||
|
|
||||||
DatabaseController.prototype.purgeCollection = function(className) {
|
DatabaseController.prototype.purgeCollection = function(className) {
|
||||||
return this.loadSchema()
|
return this.loadSchema()
|
||||||
.then((schema) => {
|
.then(schemaController => schemaController.getOneSchema(className))
|
||||||
schema.getOneSchema(className)
|
.then(schema => this.adapter.deleteObjectsByQuery(className, schema, {}));
|
||||||
})
|
|
||||||
.then((schema) => {
|
|
||||||
this.adapter.deleteObjectsByQuery(className, {}, schema);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DatabaseController.prototype.validateClassName = function(className) {
|
DatabaseController.prototype.validateClassName = function(className) {
|
||||||
|
|||||||
Reference in New Issue
Block a user