mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
#373 fixed mongodb export
This commit is contained in:
parent
66f30ff26e
commit
9aded740ca
@ -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;
|
||||
|
@ -179,7 +179,7 @@ const driver = {
|
||||
exprValue = func(db, ObjectId);
|
||||
|
||||
// return directly stream without header row
|
||||
return exprValue;
|
||||
return exprValue.stream();
|
||||
|
||||
// pass.write(structure || { __isDynamicStructure: true });
|
||||
// exprValue.on('data', (row) => pass.write(row));
|
||||
@ -331,7 +331,8 @@ const driver = {
|
||||
const res = db
|
||||
.collection(collection)
|
||||
.find(condition || {})
|
||||
.sort(sort || {});
|
||||
.sort(sort || {})
|
||||
.stream();
|
||||
|
||||
return res;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user