Adjust dbAccess log levels

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-09-26 21:06:29 +01:00
parent 9a6679f0d9
commit cf1b40f007

View File

@ -16,16 +16,16 @@ const db = client.db(dbName);
async function query(collection, query, returnId = false) { async function query(collection, query, returnId = false) {
await client.connect(); await client.connect();
logger.logger.debug(`dbAccess.query: Connecting to collection: '${collection}'`) logger.logger.trace(`dbAccess.query: Connecting to collection: '${collection}'`)
var qcoll = db.collection(collection); var qcoll = db.collection(collection);
var qcursor = qcoll.find(query); var qcursor = qcoll.find(query);
if (!returnId) { if (!returnId) {
qcursor.project({ _id: 0 }); qcursor.project({ _id: 0 });
} }
logger.logger.debug(query, "dbAccess.query: Runnung Query") logger.logger.trace(query, "dbAccess.query: Runnung Query")
increment(collection); increment(collection);
let result = await qcursor.toArray(); let result = await qcursor.toArray();
logger.logger.debug(result, "dbAccess.query: Response"); logger.logger.trace(result, "dbAccess.query: Response");
return result; return result;
} }