Dynamic module mongoose

Index

Variables

Modules

Interfaces

Classes

Functions

Variables

connection: Connection

mongo: any

mquery: any

version: string

Functions

connect(uri: string, options?: ConnectionOption, callback?: (err: any) => void): Mongoose

Parameters

  • uri: string
  • options?: ConnectionOption optional
  • callback?: (err: any) => void optional

Returns

Mongoose

createConnection(): Connection

Returns

Connection

createConnection(uri: string, options?: ConnectionOption): Connection

Parameters

Returns

Connection

createConnection(host: string, database_name: string, port?: number, options?: ConnectionOption): Connection

Parameters

  • host: string
  • database_name: string
  • port?: number optional
  • options?: ConnectionOption optional

Returns

Connection

disconnect(callback?: (err?: any) => void): Mongoose

Parameters

  • callback?: (err?: any) => void optional

Returns

Mongoose

get(key: string): any

Parameters

  • key: string

Returns

any

model(name: string, schema: Schema, collection?: string, skipInit?: boolean): Model

Parameters

  • name: string
  • schema: Schema
  • collection?: string optional
  • skipInit?: boolean optional

Returns

Model

modelNames(): Array<string>

Returns

Array<string>

plugin(plugin: (schema: "mongoose".Schema, options?: Object) => void, options?: Object): Mongoose

Parameters

  • plugin: (schema: "mongoose".Schema, options?: Object) => void
  • options?: Object optional

Returns

Mongoose

set(key: string, value: any)

Parameters

  • key: string
  • value: any