23 lines
689 B
TypeScript
23 lines
689 B
TypeScript
import * as plugins from './mongodump.plugins.js';
|
|
import { MongoDumpTarget } from './mongodb.classes.mongodumptarget.js';
|
|
|
|
export class MongoDump {
|
|
public mongoTargetObjectMap = new plugins.lik.ObjectMap<MongoDumpTarget>();
|
|
|
|
constructor() {}
|
|
|
|
public async addMongoTargetByMongoDescriptor(
|
|
descriptorArg: plugins.tsclass.database.IMongoDescriptor
|
|
) {
|
|
const mongoDumpTarget = await MongoDumpTarget.createAndInit(descriptorArg);
|
|
this.mongoTargetObjectMap.add(mongoDumpTarget);
|
|
return mongoDumpTarget;
|
|
}
|
|
|
|
public async stop() {
|
|
await this.mongoTargetObjectMap.forEach(async (mongoTargetArg) => {
|
|
await mongoTargetArg.mongoDbClient.close();
|
|
})
|
|
}
|
|
}
|