User search and creation

This commit is contained in:
buzz-lightsnack-2007 2025-04-07 22:24:00 +08:00
parent 5fa9e6efd6
commit 0458e11267
7 changed files with 109 additions and 42 deletions

View file

@ -43,6 +43,7 @@ class DBManagement {
let RESULT = [];
if ((CRITERIA && CRITERIA instanceof Object) ? !(Object.keys(CRITERIA).length) : true) {
console.log(`Searching all...`);
RESULT = await this.model.find();
} else if (CRITERIA instanceof Object) {
RESULT = await this.model.find(CRITERIA);