• Public
  • Public/Protected
  • All

Interface MongodbFindOneOptions


  • MongodbFindOneOptions



Optional batchSize

batchSize: number

Set the batchSize for the getMoreCommand when iterating over the query results.

Optional comment

comment: string

You can put a $comment field on a query to make looking in the profiler logs simpler.

Optional explain

explain: boolean

Explain the query instead of returning the data.

Optional fields

fields: Object

The fields to return in the query. Object of fields to include or exclude (not both), {'a':1}.

Optional hint

hint: Object

Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1}.

Optional limit

limit: number

Sets the limit of documents returned in the query.

Optional max

max: number

Set index bounds.

Optional maxScan

maxScan: number

Limit the number of items to scan.

Optional maxTimeMs

maxTimeMs: number

Number of milliseconds to wait before aborting the query.

Optional min

min: number

Set index bounds.

Optional partial

partial: boolean

Specify if the cursor should return partial results when querying against a sharded system.

Optional raw

raw: boolean

Return document results as raw BSON buffers.

Optional readPreference

readPreference: ReadPreference | string

The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).

Optional returnKey

returnKey: boolean

Only return the index key.

Optional showDiskLoc

showDiskLoc: boolean

Show disk location of results.

Optional skip

skip: number

Set to skip N documents ahead in your query (useful for pagination).

Optional snapshot

snapshot: boolean

Snapshot query.

Optional sort

sort: Array<any> | Object

Set to sort the documents coming back from the query. Array of indexes, [['a', 1]] etc.

Optional tailable

tailable: boolean

Specify if the cursor is tailable.

Optional timeout

timeout: boolean

Specify if the cursor can timeout.

Generated using TypeDoc