Endpoint for purging all objects in class (#2032)
* Endpoint for purging all objects in class * Use deleteObjectsByQuery * Standalone handling function and purge cache * Change endpoint url
This commit is contained in:
@@ -91,6 +91,16 @@ DatabaseController.prototype.collectionExists = function(className) {
|
||||
return this.adapter.classExists(className);
|
||||
};
|
||||
|
||||
DatabaseController.prototype.purgeCollection = function(className) {
|
||||
return this.loadSchema()
|
||||
.then((schema) => {
|
||||
schema.getOneSchema(className)
|
||||
})
|
||||
.then((schema) => {
|
||||
this.adapter.deleteObjectsByQuery(className, {}, schema);
|
||||
});
|
||||
};
|
||||
|
||||
DatabaseController.prototype.validateClassName = function(className) {
|
||||
if (this.skipValidation) {
|
||||
return Promise.resolve();
|
||||
|
||||
Reference in New Issue
Block a user