Interface Document

Index

Properties

Methods

Properties

public _id: string

public errors: Object

optional public id?: string

public isNew: boolean

public schema: Object

Methods

public equals(doc: Document): boolean

Parameters

Returns

boolean

public get(path: string, type?: new(...args: any[]) => any): any

Parameters

  • path: string
  • type?: new(...args: any[]) => any optional

Returns

any

public inspect(options?: Object): string

Parameters

  • options?: Object optional

Returns

string

public invalidate(path: string, errorMsg: string, value: any)

Parameters

  • path: string
  • errorMsg: string
  • value: any

public invalidate(path: string, error: Error, value: any)

Parameters

  • path: string
  • error: Error
  • value: any

public isDirectModified(path: string): boolean

Parameters

  • path: string

Returns

boolean

public isInit(path: string): boolean

Parameters

  • path: string

Returns

boolean

public isModified(path?: string): boolean

Parameters

  • path?: string optional

Returns

boolean

public isSelected(path: string): boolean

Parameters

  • path: string

Returns

boolean

public markModified(path: string)

Parameters

  • path: string

public modifiedPaths(): Array<string>

Returns

Array<string>

public populate(callback?: (err: any, res: T) => void): Document

Parameters

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

Returns

Document

public populate(path?: string, callback?: (err: any, res: T) => void): Document

Parameters

  • path?: string optional
  • callback?: (err: any, res: T) => void optional

Returns

Document

public populate(opt: PopulateOption, callback?: (err: any, res: T) => void): Document

Parameters

Returns

Document

public populated(path: string): any

Parameters

  • path: string

Returns

any

public remove(callback?: (err: any) => void): Query

Parameters

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

Returns

Query

public save(callback?: (err: any, res: T) => void)

Parameters

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

public set(path: string, val: any, type?: new(...args: any[]) => any, options?: Object)

Parameters

  • path: string
  • val: any
  • type?: new(...args: any[]) => any optional
  • options?: Object optional

public set(path: string, val: any, options?: Object)

Parameters

  • path: string
  • val: any
  • options?: Object optional

public set(value: Object)

Parameters

  • value: Object

public toJSON(options?: Object): Object

Parameters

  • options?: Object optional

Returns

Object

public toObject(options?: Object): Object

Parameters

  • options?: Object optional

Returns

Object

public toString(): string

Returns

string

public update(doc: Object, options: Object, callback: (err: any, affectedRows: number, raw: any) => void): Query

Parameters

  • doc: Object
  • options: Object
  • callback: (err: any, affectedRows: number, raw: any) => void

Returns

Query

public validate(cb: (err: any) => void)

Parameters

  • cb: (err: any) => void