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

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