import BaseStorage from './BaseStorage'; import Base from '../models/Base'; import { Where } from '../types/Websocket'; export interface MongoDBStorageConfig { roomCollection?: string; socketCollection?: string; } export default class MongoDBStorage implements BaseStorage { private db; private roomCollection; private socketCollection; private roomCollectionExists; private socketCollectionExists; constructor(options?: MongoDBStorageConfig); /** * get mongo collection by table name * @param table * @return */ private getCollection; /** * save data to mongo * @param table table name * @param data */ save(table: string, data: Base): Promise; /** * get data from mongo * @param table * @param where * @return */ find(table: string, where: Where): Promise; /** * find data by id * @param table * @param id * @param namespace * @return */ findById(table: string, id: string, namespace?: string): Promise; update(table: string, where: Where, data: any): Promise; remove(table: string, where: Where): Promise; }