fix(core): update
This commit is contained in:
parent
d5ff5b0ed8
commit
c09eaf613d
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartmongo',
|
name: '@pushrocks/smartmongo',
|
||||||
version: '2.0.4',
|
version: '2.0.5',
|
||||||
description: 'create a local mongodb for testing'
|
description: 'create a local mongodb for testing'
|
||||||
}
|
}
|
||||||
|
@ -42,11 +42,10 @@ export class SmartMongo {
|
|||||||
await this.mongoReplicaSet.cleanup();
|
await this.mongoReplicaSet.cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async stopAndDumpToDir(dirArg: string) {
|
public async stopAndDumpToDir(dirArg: string, nameFunctionArg?: (doc: any) => string, emptyDirArg = true) {
|
||||||
const dumpDir = plugins.smartpath.transform.makeAbsolute(dirArg);
|
|
||||||
const mongodumpInstance = new plugins.mongodump.MongoDump();
|
const mongodumpInstance = new plugins.mongodump.MongoDump();
|
||||||
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(await this.getMongoDescriptor());
|
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(await this.getMongoDescriptor());
|
||||||
await mongodumpTarget.dumpAllCollectionsToDir(dumpDir);
|
await mongodumpTarget.dumpAllCollectionsToDir(dirArg, nameFunctionArg, emptyDirArg);
|
||||||
await mongodumpInstance.stop();
|
await mongodumpInstance.stop();
|
||||||
await this.stop();
|
await this.stop();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user