22 lines
554 B
TypeScript
22 lines
554 B
TypeScript
|
import * as plugins from '../cloudly.plugins.js';
|
||
|
import { Cloudly } from '../cloudly.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();
|
||
|
}
|
||
|
}
|