Open l1ghty opened 2 years ago
@l1ghty well if the path is wrong you should use "try catch" around the for await. it will fail with the error information. You can also use transferer.toPromise() if you dont care about the progression of the transfer, just wish to await till completion
did your problem solved? @l1ghty
If the path for LocalFileSystemDuplexConnector is wrong a few lines with "remaining bytes to write" will appear. This makes it harder to spot the real problem.
Throwing a exception instead would be nice.
const mongo_connector = new MongoDBDuplexConnector({ connection: { // uri:
mongodb://username>:<password>@<hostname:const localfile_connector = new LocalFileSystemDuplexConnector({ connection: { path: dumpFolder+'/'+ db +'/'+ db+'.tar', }, });
const transferer = new MongoTransferer({ source: mongo_connector, targets: [localfile_connector], });
for await (const { total, write } of transferer) { console.info(
remaining bytes to write: ${total - write}
); }`