2024-05-28 18:45:34 +02:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
import { Cloudly } from '../classes.cloudly.js';
|
2024-04-20 12:21:41 +02: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 19:50:39 +01:00
|
|
|
this.smartdataDb = new plugins.smartdata.SmartdataDb(
|
|
|
|
this.cloudlyRef.config.data.mongoDescriptor,
|
|
|
|
);
|
2024-04-20 12:21:41 +02:00
|
|
|
await this.smartdataDb.init();
|
|
|
|
}
|
|
|
|
|
|
|
|
public async stop() {
|
|
|
|
await this.smartdataDb.close();
|
|
|
|
}
|
|
|
|
}
|