diff --git a/scripts/database/management/management.JS b/scripts/database/management/management.JS index 21c7f0d..ed83c29 100644 --- a/scripts/database/management/management.JS +++ b/scripts/database/management/management.JS @@ -26,7 +26,9 @@ class DBManagement { configure (COLLECTION, SCHEMA) { this[`schema`] = new Mongoose.Schema(SCHEMA); this[`collection`] = COLLECTION; - this.state.then(() => {this.model = this[`connection`].model(`URL`, this[`schema`]);}) + this.state.then(() => { + this.model = this[`connection`].model(this[`collection`], this[`schema`]); + }) } /* @@ -40,7 +42,7 @@ class DBManagement { await this.state; let RESULT = []; - if ((CRITERIA && CRITERIA instanceof Object) ? !Object.keys(CRITERIA).length : true) { + if ((CRITERIA && CRITERIA instanceof Object) ? !(Object.keys(CRITERIA).length) : true) { RESULT = await this.model.find(); } else if (CRITERIA instanceof Object) { RESULT = await this.model.find(CRITERIA); diff --git a/scripts/database/management/management_user.JS b/scripts/database/management/management_user.JS index 0ddd386..3a6360d 100644 --- a/scripts/database/management/management_user.JS +++ b/scripts/database/management/management_user.JS @@ -53,4 +53,6 @@ class UsersManagement extends DBManagement { return (CURRENT); }; }; -} \ No newline at end of file +} + +module.exports = UsersManagement; \ No newline at end of file