Skip to content

FindCursor

Defined in: packages/client/src/cursor.ts:11

Results of find(). Chain sort, skip, limit, project and populate, then read with toArray(), next() or for await. Large results are fetched in pages of up to 1,000.

T

  • AsyncIterable<T>

new FindCursor<T>(http, collection, filter, options?): FindCursor<T>

Defined in: packages/client/src/cursor.ts:18

HttpClient

string

Filter<Document>

FindOptions = {}

FindCursor<T>

[asyncIterator](): AsyncIterator<T>

Defined in: packages/client/src/cursor.ts:68

AsyncIterator<T>

AsyncIterable.[asyncIterator]


batchSize(size): this

Defined in: packages/client/src/cursor.ts:49

number

this


hasNext(): Promise<boolean>

Defined in: packages/client/src/cursor.ts:59

Promise<boolean>


limit(limit): this

Defined in: packages/client/src/cursor.ts:36

Total documents to return.

number

this


next(): Promise<T | null>

Defined in: packages/client/src/cursor.ts:64

Promise<T | null>


populate(…fields): this

Defined in: packages/client/src/cursor.ts:45

Replace link fields with the linked documents.

…string[]

this


project(projection): this

Defined in: packages/client/src/cursor.ts:40

Projection

this


rewind(): void

Defined in: packages/client/src/cursor.ts:73

Start over (the query runs again).

void


skip(skip): this

Defined in: packages/client/src/cursor.ts:31

number

this


sort(sort): this

Defined in: packages/client/src/cursor.ts:27

Sort

this


toArray(): Promise<T[]>

Defined in: packages/client/src/cursor.ts:53

Promise<T[]>

Made by Faeiz Furqan