#373 fixed mongodb export

This commit is contained in:
Jan Prochazka
2022-09-17 09:25:12 +02:00
parent 66f30ff26e
commit 9aded740ca
2 changed files with 6 additions and 3 deletions

View File

@@ -20,7 +20,9 @@ async function queryReader({
const driver = requireEngineDriver(connection);
const pool = await connectUtility(driver, connection, queryType == 'json' ? 'read' : 'script');
console.log(`Connected.`);
return queryType == 'json' ? await driver.readJsonQuery(pool, query) : await driver.readQuery(pool, query || sql);
const reader =
queryType == 'json' ? await driver.readJsonQuery(pool, query) : await driver.readQuery(pool, query || sql);
return reader;
}
module.exports = queryReader;