Interface Connection

Hierarchy

Index

Properties

Methods

Properties

public collections: { [index: string]: "mongoose".Collection; }

(): Collection

Returns

Collection

public db: any

public readyState: number

Methods

public addListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public close(callback?: (err: any) => void): Connection

Parameters

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

Returns

Connection

public collection(name: string, options?: Object): Collection

Parameters

  • name: string
  • options?: Object optional

Returns

Collection

public constructor(base: Mongoose): Connection

Parameters

Returns

Connection

public emit(event: string, args?: Array<any>): boolean

Parameters

  • event: string
  • args?: Array<any> optional

Returns

boolean

public listeners(event: string): Array<Function>

Parameters

  • event: string

Returns

Array<Function>

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

Parameters

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

Returns

Model

public modelNames(): Array<string>

Returns

Array<string>

public on(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public once(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public open(host: string, database?: string, port?: number, options?: ConnectionOption, callback?: (err: any) => void): Connection

Parameters

  • host: string
  • database?: string optional
  • port?: number optional
  • options?: ConnectionOption optional
  • callback?: (err: any) => void optional

Returns

Connection

public openSet(uris: string, database?: string, options?: ConnectionSetOption, callback?: (err: any) => void): Connection

Parameters

  • uris: string
  • database?: string optional
  • options?: ConnectionSetOption optional
  • callback?: (err: any) => void optional

Returns

Connection

public removeAllListeners(event?: string): EventEmitter

Parameters

  • event?: string optional

Returns

EventEmitter

public removeListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public setMaxListeners(n: number)

Parameters

  • n: number