23 lines
691 B
TypeScript
23 lines
691 B
TypeScript
import * as plugins from './mongodump.plugins.js';
|
|
import { MongoDumpTarget } from './mongodump.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();
|
|
})
|
|
}
|
|
}
|