fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartmongo',
|
||||
version: '2.0.9',
|
||||
version: '2.0.10',
|
||||
description: 'create a local mongodb for testing'
|
||||
}
|
||||
|
10
ts/index.ts
10
ts/index.ts
@ -55,9 +55,15 @@ export class SmartMongo {
|
||||
* like stop() but allows you to actually store
|
||||
* the database on disk
|
||||
*/
|
||||
public async stopAndDumpToDir(dirArg: string, nameFunctionArg?: (doc: any) => string, emptyDirArg = true) {
|
||||
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());
|
||||
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(
|
||||
await this.getMongoDescriptor()
|
||||
);
|
||||
await mongodumpTarget.dumpAllCollectionsToDir(dirArg, nameFunctionArg, emptyDirArg);
|
||||
await mongodumpInstance.stop();
|
||||
await this.stop();
|
||||
|
@ -4,12 +4,7 @@ import * as smartdata from '@push.rocks/smartdata';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
|
||||
export {
|
||||
mongodump,
|
||||
smartdata,
|
||||
smartpath,
|
||||
smartpromise,
|
||||
}
|
||||
export { mongodump, smartdata, smartpath, smartpromise };
|
||||
|
||||
// thirdparty
|
||||
import * as mongoPlugin from 'mongodb-memory-server';
|
||||
|
Reference in New Issue
Block a user