fix(core): update

This commit is contained in:
2023-08-08 16:59:47 +02:00
parent 2763da6efa
commit a5ddbd44af
9 changed files with 219 additions and 29 deletions

View File

@ -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'
}

View File

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

View File

@ -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';