Cargo Features

[dependencies]
mongodb = { version = "2.8.2", 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 whenever mongodb is added without default-features = false somewhere in the dependency tree.

tokio-runtime default tokio-sync? = serde_bytes

Enables net, process, rt and time of tokio

async-std-runtime sync? = async-executor, async-std, async-std-resolver

Enables tokio-util, attributes and unstable of async-std

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.

Enables uuid-0_8 of bson

bson-uuid-1

Enable support for v1.x of the uuid crate in the public API of the BSON library.

Enables uuid-1 of bson

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. These features may have been created by mistake, and this functionality may be removed in the future.

async-executor async-std-runtime?

Enables async-executor =1.5.1

TODO RUST-1768: remove this

flate2 zlib-compression?
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?
zstd zstd-compression?

Enables zstd ^0.11.2

async-std async-std-runtime?
async-std-resolver async-std-runtime?

Enables async-std-resolver ^0.21.1

serde_bytes tokio-runtime
reqwest aws-auth? azure-kms? gcp-kms?

Enables reqwest ^0.11.2