fix(core): update

This commit is contained in:
2022-06-06 17:38:35 +02:00
parent d5ff5b0ed8
commit c09eaf613d
2 changed files with 3 additions and 4 deletions

View File

@@ -42,11 +42,10 @@ export class SmartMongo {
await this.mongoReplicaSet.cleanup();
}
public async stopAndDumpToDir(dirArg: string) {
const dumpDir = plugins.smartpath.transform.makeAbsolute(dirArg);
public async stopAndDumpToDir(dirArg: string, nameFunctionArg?: (doc: any) => string, emptyDirArg = true) {
const mongodumpInstance = new plugins.mongodump.MongoDump();
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(await this.getMongoDescriptor());
await mongodumpTarget.dumpAllCollectionsToDir(dumpDir);
await mongodumpTarget.dumpAllCollectionsToDir(dirArg, nameFunctionArg, emptyDirArg);
await mongodumpInstance.stop();
await this.stop();
}