fix(core): update

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

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartmongo',
version: '2.0.4',
version: '2.0.5',
description: 'create a local mongodb for testing'
}

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();
}