mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 06:06:00 +00:00
#373 fixed mongodb export
This commit is contained in:
@@ -20,7 +20,9 @@ async function queryReader({
|
|||||||
const driver = requireEngineDriver(connection);
|
const driver = requireEngineDriver(connection);
|
||||||
const pool = await connectUtility(driver, connection, queryType == 'json' ? 'read' : 'script');
|
const pool = await connectUtility(driver, connection, queryType == 'json' ? 'read' : 'script');
|
||||||
console.log(`Connected.`);
|
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;
|
module.exports = queryReader;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ const driver = {
|
|||||||
exprValue = func(db, ObjectId);
|
exprValue = func(db, ObjectId);
|
||||||
|
|
||||||
// return directly stream without header row
|
// return directly stream without header row
|
||||||
return exprValue;
|
return exprValue.stream();
|
||||||
|
|
||||||
// pass.write(structure || { __isDynamicStructure: true });
|
// pass.write(structure || { __isDynamicStructure: true });
|
||||||
// exprValue.on('data', (row) => pass.write(row));
|
// exprValue.on('data', (row) => pass.write(row));
|
||||||
@@ -331,7 +331,8 @@ const driver = {
|
|||||||
const res = db
|
const res = db
|
||||||
.collection(collection)
|
.collection(collection)
|
||||||
.find(condition || {})
|
.find(condition || {})
|
||||||
.sort(sort || {});
|
.sort(sort || {})
|
||||||
|
.stream();
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user