Class Cursor

Index

Properties

Methods

Properties

public static CLOSED: number

public static GET_MORE: number

public static INIT: number

public static OPEN: number

Methods

public batchSize(batchSize: number, callback?: (err: Error, result: any) => void): Cursor

Parameters

  • batchSize: number
  • callback?: (err: Error, result: any) => void optional

Returns

Cursor

public close(callback: (err: Error, result: any) => void)

Parameters

  • callback: (err: Error, result: any) => void

public count(applySkipLimit: boolean, callback: (err: Error, count: number) => void)

Parameters

  • applySkipLimit: boolean
  • callback: (err: Error, count: number) => void

public each(callback: (err: Error, item: any) => void)

Parameters

  • callback: (err: Error, item: any) => void

public explain(callback: (err: Error, result: any) => void)

Parameters

  • callback: (err: Error, result: any) => void

public isClosed(): boolean

Returns

boolean

public limit(limit: number, callback?: (err: Error, result: any) => void): Cursor

Parameters

  • limit: number
  • callback?: (err: Error, result: any) => void optional

Returns

Cursor

public nextObject(callback: (err: Error, doc: any) => void)

Parameters

  • callback: (err: Error, doc: any) => void

public rewind(): Cursor

Returns

Cursor

public setReadPreference(preference: string, callback?: Function): Cursor

Parameters

  • preference: string
  • callback?: Function optional

Returns

Cursor

public skip(skip: number, callback?: (err: Error, result: any) => void): Cursor

Parameters

  • skip: number
  • callback?: (err: Error, result: any) => void optional

Returns

Cursor

public sort(keyOrList: any, callback?: (err: Error, result: any) => void): Cursor

Parameters

  • keyOrList: any
  • callback?: (err: Error, result: any) => void optional

Returns

Cursor

public sort(keyOrList: String, direction: string, callback: (err: Error, result: any) => void): Cursor

Parameters

  • keyOrList: String
  • direction: string
  • callback: (err: Error, result: any) => void

Returns

Cursor

public stream(): CursorStream

Returns

CursorStream

public toArray(callback: (err: Error, results: any[]) => any)

Parameters

  • callback: (err: Error, results: any[]) => any