24 lines
551 B
TypeScript
24 lines
551 B
TypeScript
import * as plugins from '../plugins.js';
|
|
import { Cloudly } from '../classes.cloudly.js';
|
|
|
|
export class MongodbConnector {
|
|
// INSTANCE
|
|
private cloudlyRef: Cloudly;
|
|
public smartdataDb: plugins.smartdata.SmartdataDb;
|
|
|
|
constructor(cloudlyRefArg: Cloudly) {
|
|
this.cloudlyRef = cloudlyRefArg;
|
|
}
|
|
|
|
public async init() {
|
|
this.smartdataDb = new plugins.smartdata.SmartdataDb(
|
|
this.cloudlyRef.config.data.mongoDescriptor,
|
|
);
|
|
await this.smartdataDb.init();
|
|
}
|
|
|
|
public async stop() {
|
|
await this.smartdataDb.close();
|
|
}
|
|
}
|