vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

Struct FindOptions

struct FindOptions ;

Fields

NameTypeDescription
allowDiskUse std.typecons.Nullable!(bool)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 std.typecons.Nullable!(bool)Get partial results from a mongos if some shards are down (instead of throwing an error).
batchSize std.typecons.Nullable!(int)The number of documents to return per batch.
collation std.typecons.Nullable!(vibe.db.mongo.collection.Collation)Collation allows users to specify language-specific rules for string comparison, such as rules for letter-case and accent marks.
comment std.typecons.Nullable!(string)Users can specify an arbitrary string to help trace the operation through the database profiler, currentOp, and logs.
cursorType CursorTypeIndicates the type of cursor to use. This value includes both the tailable and awaitData options.
hint std.typecons.Nullable!(vibe.data.bson.Bson)The index to use. Specify either the index name as a string or the index key pattern.
limit std.typecons.Nullable!(long)The maximum number of documents to return.
max std.typecons.Nullable!(vibe.data.bson.Bson)The exclusive upper bound for a specific index.
maxAwaitTimeMS std.typecons.Nullable!(long)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 std.typecons.Nullable!(long)Maximum number of documents or index keys to scan when executing the query.
maxTimeMS std.typecons.Nullable!(long)The maximum amount of time to allow the query to run.
min std.typecons.Nullable!(vibe.data.bson.Bson)The exclusive lower bound for a specific index.
noCursorTimeout std.typecons.Nullable!(bool)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 std.typecons.Nullable!(bool)Enables optimization when querying the oplog for a range of ts values.
ordered std.typecons.Nullable!(bool)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 std.typecons.Nullable!(vibe.data.bson.Bson)Limits the fields to return for all matching documents.
readConcern std.typecons.Nullable!(vibe.db.mongo.collection.ReadConcern)Specifies the read concern. Only compatible with a write stage. (e.g. $out, $merge)
returnKey std.typecons.Nullable!(bool)If true, returns only the index keys in the resulting documents.
showRecordId std.typecons.Nullable!(bool)Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents.
skip std.typecons.Nullable!(long)The number of documents to skip before returning.
snapshot std.typecons.Nullable!(bool)Prevents the cursor from returning a document more than once because of an intervening write operation.
sort std.typecons.Nullable!(vibe.data.bson.Bson)The order in which to return matching documents.

Methods

NameDescription
maxAwaitTime (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 (d) The maximum amount of time to allow the query to run.

See Also

https://docs.mongodb.com/manual/reference/command/find/

Standards

https://github.com/mongodb/specifications/blob/525dae0aa8791e782ad9dd93e507b60c55a737bb/source/crud/crud.rst#id16

Authors

Jan Jurzitza

Copyright

© 2022 Jan Jurzitza

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.