FindOptions

Members

Functions

maxAwaitTime
void maxAwaitTime(Duration d)

The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored.

maxTime
void maxTime(Duration d)

The maximum amount of time to allow the query to run.

Variables

allowDiskUse
Nullable!bool allowDiskUse;

Enables writing to temporary files on the server. When set to true, the server can write temporary data to disk while executing the find operation.

allowPartialResults
Nullable!bool allowPartialResults;

Get partial results from a mongos if some shards are down (instead of throwing an error).

batchSize
Nullable!int batchSize;

The number of documents to return per batch.

collation
Nullable!Collation collation;

Collation allows users to specify language-specific rules for string comparison, such as rules for letter-case and accent marks.

comment
Nullable!string comment;

Users can specify an arbitrary string to help trace the operation through the database profiler, currentOp, and logs.

cursorType
CursorType cursorType;

Indicates the type of cursor to use. This value includes both the tailable and awaitData options.

hint
Nullable!Bson hint;

The index to use. Specify either the index name as a string or the index key pattern.

limit
Nullable!long limit;

The maximum number of documents to return.

max
Nullable!Bson max;

The exclusive upper bound for a specific index.

maxAwaitTimeMS
Nullable!long maxAwaitTimeMS;

The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored.

maxScan
Nullable!long maxScan;

Maximum number of documents or index keys to scan when executing the query.

maxTimeMS
Nullable!long maxTimeMS;

The maximum amount of time to allow the query to run.

min
Nullable!Bson min;

The exclusive lower bound for a specific index.

noCursorTimeout
Nullable!bool noCursorTimeout;

The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.

oplogReplay
Nullable!bool oplogReplay;

Enables optimization when querying the oplog for a range of ts values.

ordered
Nullable!bool ordered;

If true, when an insert fails, return without performing the remaining writes. If false, when a write fails, continue with the remaining writes, if any.

projection
Nullable!Bson projection;

Limits the fields to return for all matching documents.

readConcern
Nullable!ReadConcern readConcern;

Specifies the read concern. Only compatible with a write stage. (e.g. $out, $merge)

returnKey
Nullable!bool returnKey;

If true, returns only the index keys in the resulting documents.

showRecordId
Nullable!bool showRecordId;

Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents.

singleBatch
Nullable!bool singleBatch;

Determines whether to close the cursor after the first batch.

skip
Nullable!long skip;

The number of documents to skip before returning.

snapshot
Nullable!bool snapshot;

Prevents the cursor from returning a document more than once because of an intervening write operation.

sort
Nullable!Bson sort;

The order in which to return matching documents.

See Also

Meta