Class Mongoose

Index

Properties

Methods

Properties

public connection: Connection

public mongo: any

public mquery: any

public version: string

Methods

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

Parameters

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

Returns

Mongoose

public createConnection(): Connection

Returns

Connection

public createConnection(uri: string, options?: Object): Connection

Parameters

  • uri: string
  • options?: Object optional

Returns

Connection

public 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

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

Parameters

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

Returns

Mongoose

public get(key: string): any

Parameters

  • key: string

Returns

any

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

Parameters

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

Returns

Model

public modelNames(): Array<string>

Returns

Array<string>

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

Parameters

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

Returns

Mongoose

public set(key: string, value: any)

Parameters

  • key: string
  • value: any