fix(core): update
This commit is contained in:
@ -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'
|
||||
}
|
||||
|
12
ts/index.ts
12
ts/index.ts
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user