mogno export+import uses EJSON

This commit is contained in:
Jan Prochazka
2024-08-26 15:09:44 +02:00
parent 62de736bce
commit d54b47f713
2 changed files with 18 additions and 2 deletions

View File

@@ -245,8 +245,23 @@ const driver = {
const db = await getScriptableDb(pool);
exprValue = func(db, ObjectId.createFromHexString);
const pass = new stream.PassThrough({
objectMode: true,
highWaterMark: 100,
});
exprValue
.forEach((row) => pass.write(transformMongoData(row)))
.then(() => {
pass.end();
// pass.end(() => {
// pass.emit('end');
// })
});
return pass;
// return directly stream without header row
return exprValue.stream();
// return exprValue.stream();
// pass.write(structure || { __isDynamicStructure: true });
// exprValue.on('data', (row) => pass.write(row));