The MongoDB Rust driver team is pleased to announce the v2.4.0 release of the mongodb
crate, now available for download from crates.io.
Highlighted Changes
In-Use Encryption
This release brings support for Client-Side Field Level Encryption and Queryable Encryption. For detailed installation and usage instructions, please see the Encryption section of the driver manual. Please note that the API is currently unstable and may change in breaking ways in future releases.
GridFS
This release adds support for GridFS, allowing storage and retrieval of files that exceed the BSON document size limit. Please see the documentation of the new gridfs module for more information.
Streaming Monitoring Protocol
This release can now use the streaming monitoring protocol with MongoDB 4.4+ servers, reducing the time it takes for the client to discover server state changes compared to the old polling protocol.
Tracing Integration
The driver now emits tracing
events at points of interest. To consume these events, you must enable the driver’s tracing-unstable
feature flag and either:
- register a tracing
Subscriber
in your application (see the tracing docs), OR - register a
log
-compatible logger in your application (see thelog
documentation for details), and enable alog
compatibility feature flag fortracing
, as detailed here.
This API is considered unstable as the tracing
crate has not reached 1.0 yet; future minor versions of the driver may upgrade the tracing
dependency to a new version which is not backwards-compatible with Subscriber
s that depend on older versions of tracing
.
Events will be emitted under the following targets:
mongodb::command
: Events related to command execution starting, succeeding, or failing.mongodb::connection
: Events related to the driver’s underlying connection pools and their connections.
Future work will introduce events under additional targets and may add driver-defined tracing spans for intervals of interest.
MSRV Increase
The minimum supported Rust version (MSRV) for this crate is now Rust 1.57.
Included Changes
Below are a selected list of changes with user impact; for a full list of changes see this GitHub query.
New Features
- RUST-1384 Implement auto encryption (#717)
- RUST-1385 Implement explicit encryption (#726)
- RUST-1305 Use uuid 1.x internally and add support for bson uuid 1.x (#709)
- RUST-1400 GridFS download methods (#747)
- RUST-1478 GridFS upload methods (#751)
- RUST-1401 Additional GridFS API (#763)
- RUST-580 Add tracing integration and command tracing events (#757)
- RUST-1510 Implement connection pool tracing messages (#766)
Improvements
- RUST-360 Streaming monitoring protocol (#721)
- RUST-1071 Add comment field to all options structs
- minor: improve compile error when sync and tokio-runtime features are enabled (#788)
- extend error types to impl serialization (#797) (Thanks borngraced!)
Bugfixes
- RUST-1443 Ensure monitors close after server is removed from topology (#744)
- RUST-1576 Allow "timeseries"-typed collections in list_collections output (#814)
- minor: fix documentation of new features (#823)
Tasks
- RUST-1253 Add AWS Lambda Examples (#714)
- Deps: bump dependencies (#722) (Thanks Some-Dood!)
- RUST-1445 Bump MSRV to 1.57 (#727)
- RUST-1403 Remove oldtime feature from chrono dependency (#691) (Thanks oskgo!)
- RUST-1450 Bump pretty_assertions dependency to 1.3.0 (#734)
- Fix typo in README (#735) (Thanks sgasse!)
- minor: document cursor/change stream Drop implementations (#745)
- RUST-1560 Fix README typo (#798) (Thanks lonesometraveler!)