fix(core): update

This commit is contained in:
2022-06-06 16:51:41 +02:00
parent a01755fb9e
commit 1783d72395
6 changed files with 128 additions and 92 deletions

View File

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

View File

@ -38,6 +38,16 @@ export class SmartMongo {
}
public async stop() {
await this.mongoReplicaSet.stop(true);
await this.mongoReplicaSet.stop();
await this.mongoReplicaSet.cleanup();
}
public async stopAndDumpToDir(dirArg: string) {
const dumpDir = plugins.smartpath.transform.makeAbsolute(dirArg);
const mongodumpInstance = new plugins.mongodump.MongoDump();
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(await this.getMongoDescriptor());
await mongodumpTarget.dumpAllCollectionsToDir(dumpDir);
await mongodumpInstance.stop();
await this.stop();
}
}

View File

@ -1,9 +1,13 @@
// @pushrocks scope
import * as mongodump from '@pushrocks/mongodump';
import * as smartdata from '@pushrocks/smartdata';
import * as smartpath from '@pushrocks/smartpath';
import * as smartpromise from '@pushrocks/smartpromise';
export {
mongodump,
smartdata,
smartpath,
smartpromise,
}