2024-05-28 16:45:34 +00:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
import { Cloudly } from '../classes.cloudly.js';
|
2024-04-20 10:21:41 +00:00
|
|
|
|
|
|
|
export class MongodbConnector {
|
|
|
|
// INSTANCE
|
|
|
|
private cloudlyRef: Cloudly;
|
|
|
|
public smartdataDb: plugins.smartdata.SmartdataDb;
|
|
|
|
|
|
|
|
constructor(cloudlyRefArg: Cloudly) {
|
|
|
|
this.cloudlyRef = cloudlyRefArg;
|
|
|
|
}
|
|
|
|
|
|
|
|
public async init() {
|
2024-10-27 18:50:39 +00:00
|
|
|
this.smartdataDb = new plugins.smartdata.SmartdataDb(
|
|
|
|
this.cloudlyRef.config.data.mongoDescriptor,
|
|
|
|
);
|
2024-04-20 10:21:41 +00:00
|
|
|
await this.smartdataDb.init();
|
|
|
|
}
|
|
|
|
|
|
|
|
public async stop() {
|
|
|
|
await this.smartdataDb.close();
|
|
|
|
}
|
|
|
|
}
|