Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mongo

Mongo Storage Adapter, keeps bBot brain data collections as sub-collection of a single parent Mongo DB model/collection. The memory sub-collection keeps the brain's in-memory data assigned against it's key (e.g. users). Long-term data is stored in sub-collections alongside memory, using either a key for key/value pairs, or a key-less array for serial data.

Hierarchy

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

  • new Mongo(bot: any): Mongo

Properties

bot

bot: "/home/circleci/repo/src/index"

The current bBot instance

model

model: Model<Document>

name

name: string = "mongo-storage-adapter"

Optional store

store: mongoose.Mongoose

Methods

find

  • find(sub: string, params: any): Promise<any>

findOne

  • findOne(sub: string, params: any): Promise<any>

keep

  • keep(sub: string, data: any): Promise<void>

loadMemory

  • loadMemory(): Promise<any>

lose

  • lose(sub: string, params: any): Promise<void>

saveMemory

  • saveMemory(data: any): Promise<void>

shutdown

  • shutdown(): Promise<void>

start

  • start(): Promise<void>

Object literals

config

config: object

autoIndex

autoIndex: boolean = true

keepAlive

keepAlive: number = 120

poolSize

poolSize: number = 10

reconnectInterval

reconnectInterval: number = 500

reconnectTries

reconnectTries: number = Number.MAX_VALUE

useNewUrlParser

useNewUrlParser: boolean = true

Generated using TypeDoc