Expand description
Contains all of the types needed to specify options to MongoDB operations.
Most of the options structs in this module use the
typed-builder
crate to derive a type-safe builder
API on them. For example, to create an instance of
FindOptions
with only limit
and batch_size
set, the builder
API can be used as follows:
use mongodb::options::FindOptions;
let options = FindOptions::builder()
.limit(20)
.batch_size(5)
.build();
Re-exports§
pub use crate::action::csfle::DataKeyOptions;
in-use-encryption
pub use crate::action::csfle::EncryptOptions;
in-use-encryption
Modules§
- oidc
- Contains the functionality for
OIDC
authorization and authentication. Contains the functionality forOIDC
authorization and authentication.
Structs§
- Aggregate
Options - Specifies the options to a
Collection::aggregate
operation. - Bulk
Write Options - The supported options for
bulk_write
. - Change
Stream Options - These are the valid options that can be passed to the
watch
method for creating aChangeStream
. - Change
Stream PreAnd Post Images - Specifies how change stream pre- and post-images should be supported.
- Client
Options - Contains the options that can be used to create a new
Client
. - Clustered
Index - Specifies options for a clustered collection. Some fields have required values; the
Default
impl uses those values. - Collation
- A collation configuration. See the official MongoDB documentation for more information on each of the fields.
- Collection
Options - These are the valid options for creating a
Collection
withDatabase::collection_with_options
. - Connection
String - Contains the options that can be set via a MongoDB connection string.
- Count
Options - Specifies the options to a
Collection::count_documents
operation. - Create
Collection Options - These are the valid options for creating a collection with
Database::create_collection
. - Create
Index Options - Specifies the options to a
Collection::create_index
orCollection:: create_indexes
operation. - Create
Search Index Options - Options for Collection::create_search_index. Present to allow additional options to be added in the future as a non-breaking change.
- Credential
- A struct containing authentication information.
- Database
Options - These are the valid options for creating a
Database
withClient::database_with_options
. - Delete
Many Model - Deletes multiple documents.
- Delete
OneModel - Deletes a single document.
- Delete
Options - Specifies the options to a
Collection::delete_one
orCollection::delete_many
operation. - Distinct
Options - Specifies the options to a
Collection::distinct
operation. - Driver
Info - Extra information to append to the driver version in the metadata of the handshake with the server. This should be used by libraries wrapping the driver, e.g. ODMs.
- Drop
Collection Options - Specifies the options to a
Collection::drop
operation. - Drop
Database Options - Specifies the options to a
Database::drop
operation. - Drop
Index Options - Specifies the options to a
Collection::drop_index
orCollection::drop_indexes
operation. - Drop
Search Index Options - Options for Collection::drop_search_index. Present to allow additional options to be added in the future as a non-breaking change.
- Estimated
Document Count Options - Specifies the options to a
Collection::estimated_document_count
operation. - Find
OneAnd Delete Options - Specifies the options to a
Collection::find_one_and_delete
operation. - Find
OneAnd Replace Options - Specifies the options to a
Collection::find_one_and_replace
operation. - Find
OneAnd Update Options - Specifies the options to a
Collection::find_one_and_update
operation. - Find
OneOptions - Specifies the options to a
Collection::find_one
operation. - Find
Options - Specifies the options to a
Collection::find
operation. - Grid
FsBucket Options - Contains the options for creating a
GridFsBucket
. - Grid
FsDownload ByName Options - Contains the options for downloading a file from a
GridFsBucket
by name. - Grid
FsFind OneOptions - Contains the options for finding a single
FilesCollectionDocument
in aGridFsBucket
. - Grid
FsFind Options - Contains the options for finding
FilesCollectionDocument
s in aGridFsBucket
. - Grid
FsUpload Options - Contains the options for uploading a file to a
GridFsBucket
. - Hedged
Read Options - Specifies hedging behavior for reads.
- Index
Option Defaults - Specifies default configuration for indexes created on a collection, including the _id index.
- Index
Options - These are the valid options for specifying an
IndexModel
. For more information on these properties, see the documentation. - Insert
Many Options - Specifies the options to a
Collection::insert_many
operation. - Insert
OneModel - Inserts a single document.
- Insert
OneOptions - Specifies the options to a
Collection::insert_one
operation. - List
Collections Options - Specifies the options to a
Database::list_collections
operation. - List
Databases Options - Specifies the options to a
Client::list_databases
operation. - List
Indexes Options - Specifies the options to a
Collection::list_indexes
operation. - List
Search Index Options - Options for Collection::list_search_indexes. Present to allow additional options to be added in the future as a non-breaking change.
- Read
Concern - Specifies the consistency and isolation properties of read operations from replica sets and replica set shards.
- Read
Preference Options - Specifies read preference options for non-primary read preferences.
- Replace
OneModel - Replaces a single document.
- Replace
Options - Specifies the options to a
Collection::replace_one
operation. - Resolver
Config dns-resolver
- Configuration for the upstream nameservers to use for resolution.
- RunCommand
Options - Specifies the options to a
Database::run_command
operation. - RunCursor
Command Options - Specifies the options to a
Database::run_cursor_command
operation. - Server
Api - Options used to declare a stable server API. For more information, see the Stable API manual page.
- Session
Options - Contains the options that can be used to create a new
ClientSession
. - Timeseries
Options - Specifies options for creating a timeseries collection.
- TlsOptions
- Specifies the TLS configuration that the
Client
should use. - Transaction
Options - Contains the options that can be used for a transaction.
- Update
Many Model - Updates multiple documents.
- Update
OneModel - Updates a single document.
- Update
Options - Specifies the options to a
Collection::update_one
orCollection::update_many
operation. - Update
Search Index Options - Options for Collection::update_search_index. Present to allow additional options to be added in the future as a non-breaking change.
- Write
Concern - Specifies the level of acknowledgement requested from the server for write operations.
Enums§
- Acknowledgment
- The type of the
w
field in aWriteConcern
. - Auth
Mechanism - The authentication mechanisms supported by MongoDB.
- Collation
Alternate - Setting that determines whether collation should consider whitespace and punctuation as base characters for purposes of comparison.
- Collation
Case First - Setting that determines sort order of case differences during case tertiary level comparisons. For more info, see http://userguide.icu-project.org/collation/customization.
- Collation
MaxVariable - Field that determines up to which characters are considered ignorable when alternate: “shifted”.
- Collation
Strength - The level of comparison to perform. Corresponds to ICU Comparison Levels.
- Commit
Quorum - The minimum number of data-bearing voting replica set members (i.e. commit quorum), including the primary, that must report a successful index build before the primary marks the indexes as ready.
- Compressor
zstd-compression
orzlib-compression
orsnappy-compression
- The compressors that may be used to compress messages sent to and decompress messages returned from the server. Note that each variant requires enabling a corresponding feature flag.
- Cursor
Type - Specifies the type of cursor to return from a find operation.
- Full
Document Before Change Type - Describes the modes for configuring the
ChangeStreamEvent::full_document_before_change
field. - Full
Document Type - Describes the modes for configuring the
ChangeStreamEvent::full_document
field. - Hint
- Specifies the index to use for an operation.
- Host
Info - Specification for mongodb server connections.
- Index
Version - The version of the index. Version 0 Indexes are disallowed as of MongoDB 3.2.
- Read
Concern Level - Specifies the level consistency and isolation properties of a given
ReadCocnern
. - Read
Preference - Specifies how the driver should route a read operation to members of a replica set.
- Return
Document - Specifies whether a
Collection::find_one_and_replace
andCollection::find_one_and_update
operation should return the document before or after modification. - Selection
Criteria - Describes which servers are suitable for a given operation.
- Server
Address - An enum representing the address of a MongoDB server.
- Server
ApiVersion - Specifies the server API version to declare
- Server
Monitoring Mode - Which server monitoring protocol to use.
- Sphere2D
Index Version - Specify the version for a
2dsphere
index. For more information, see Versions. - Text
Index Version - Specify the version for a
text
index. For more information, see Versions. - Timeseries
Granularity - The units you’d use to describe the expected interval between subsequent measurements for a time-series.
- Tls
- Specifies whether TLS configuration should be used with the operations that the
Client
performs. - Update
Modifications - Enum modeling the modifications to apply during an update. For details, see the official MongoDB documentation
- Validation
Action - Specifies whether the database should return an error or simply raise a warning if inserted documents do not pass the validation.
- Validation
Level - Specifies how strictly the database should apply validation rules to existing documents during an update.
- Write
Model - A single write to be performed within a
bulk_write
operation.