Cargo Features
[dependencies]
mongodb = { version = "2.7.1", default-features = false, features = ["tokio-runtime", "async-std-runtime", "sync", "tokio-sync", "openssl-tls", "bson-chrono-0_4", "bson-serde_with", "bson-uuid-0_8", "bson-uuid-1", "aws-auth", "azure-kms", "gcp-kms", "zstd-compression", "zlib-compression", "snappy-compression", "in-use-encryption-unstable", "tracing-unstable"] }
NOTE: any new features added to this list should also be added to the features list in the [package.metadata.docs.rs] section below.
- default = tokio-runtime
-
The
tokio-runtime
feature is set by default whenevermongodb
is added without
somewhere in the dependency tree.default-features = false - tokio-runtime default tokio-sync? = serde_bytes
- async-std-runtime sync? = async-executor, async-std, async-std-resolver
-
Enables attributes and unstable of async-std, compat of tokio-util
- sync = async-std-runtime
-
Affects
mongodb::sync
… - tokio-sync = tokio-runtime
-
Affects
mongodb::sync
… - openssl-tls = openssl, openssl-probe, tokio-openssl
-
Affects
options::TlsOptions.allow_invalid_hostnames
… - bson-chrono-0_4
-
Enable support for v0.4 of the chrono crate in the public API of the BSON library.
Enables chrono-0_4 of bson
- bson-serde_with
-
Enable support for the serde_with crate in the BSON library.
Enables serde_with of bson
- bson-uuid-0_8
-
Enable support for v0.8 of the uuid crate in the public API of the BSON library.
- bson-uuid-1
-
Enable support for v1.x of the uuid crate in the public API of the BSON library.
- aws-auth = reqwest
-
Enable support for MONGODB-AWS authentication.
This can only be used with the tokio-runtime feature flag. - azure-kms = reqwest
-
Enable support for on-demand Azure KMS credentials.
This can only be used with the tokio-runtime feature flag. - gcp-kms = reqwest
-
Enable support for on-demand GCP KMS credentials.
This can only be used with the tokio-runtime feature flag. - zstd-compression = zstd
- zlib-compression = flate2
- snappy-compression = snap
- in-use-encryption-unstable = mongocrypt, num_cpus, rayon
-
Enables support for client-side field level encryption and queryable encryption.
The In Use Encryption API is unstable and may have backwards-incompatible changes in minor version updates.Affects
options::DropCollectionOptions.encrypted_fields
,options::CreateCollectionOptions.encrypted_fields
… - tracing-unstable = log, tracing
-
Enables support for emitting tracing events. The tracing API is unstable and may have backwards-incompatible changes in minor version updates. TODO: pending https://github.com/tokio-rs/tracing/issues/2036 stop depending directly on log.
Affects
options::ClientOptions.tracing_max_document_length_bytes
…
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features.
- async-executor async-std-runtime?
-
Enables async-executor =1.5.1
TODO RUST-1768: remove this
- flate2 zlib-compression?
-
With default (rust_backend)
- log tracing-unstable?
- mongocrypt in-use-encryption-unstable?
- num_cpus in-use-encryption-unstable?
- openssl openssl-tls?
- openssl-probe openssl-tls?
- rayon in-use-encryption-unstable?
- snap snappy-compression?
- tokio-openssl openssl-tls?
- tracing tracing-unstable?
-
With default features
- zstd zstd-compression?
-
Enables default features of zstd ^0.11.2
- async-std async-std-runtime?
-
With default features
- async-std-resolver async-std-runtime?
-
Enables default (system-config) of async-std-resolver ^0.21.1
- serde_bytes tokio-runtime
- reqwest aws-auth? azure-kms? gcp-kms?
-
With json and rustls-tls