Fix bug where query function returned empty array

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-09-11 20:47:04 +01:00
parent ac24cb571e
commit c7ea029c11

View File

@ -24,8 +24,9 @@ async function query(collection, query, returnId = false) {
log.out(`dbAccess.query: Running Query: ${JSON.stringify(query)}`, "info");
increment(collection);
log.out("dbAccess.query: Query response:");
console.log(await qcursor.toArray());
return await qcursor.toArray();
let result = await qcursor.toArray();
console.log(result);
return result;
}
async function queryProject(collection, query, projection) {