stream header flag + export from mongo

This commit is contained in:
Jan Prochazka
2021-04-08 17:49:57 +02:00
parent a5d37eb528
commit 20fccf51d9
9 changed files with 83 additions and 12 deletions

View File

@@ -22,7 +22,13 @@ class TableWriter {
this.currentFile = path.join(jsldir(), `${this.jslid}.jsonl`);
this.currentRowCount = 0;
this.currentChangeIndex = 1;
fs.writeFileSync(this.currentFile, JSON.stringify(structure) + '\n');
fs.writeFileSync(
this.currentFile,
JSON.stringify({
...structure,
__isStreamHeader: true,
}) + '\n'
);
this.currentStream = fs.createWriteStream(this.currentFile, { flags: 'a' });
this.writeCurrentStats(false, false);
this.resultIndex = resultIndex;