cargo mongodb 3.0.0
v3.0.0

3 days ago

The MongoDB Rust driver team is pleased to announce the v3.0.0 release of the mongodb crate, now available for download from crates.io.

Highlighted Changes

Breaking Changes

3.0 introduces a wide variety of improvements that required backwards-incompatible API changes; in most cases these changes should require only minor updates in application code.

Most notably:

  • Fluent API: Async methods that accepted options have been updated to allow the individual options to be given directly in line with the call to reduce required boilerplate.
  • Events: 3.0 introduces the EventHandler type, which can be constructed from a callback, async callback, or an async channel sender.
  • Async Runtime: 3.0 only supports tokio; support for async-std has been discontinued.

For detailed information on breaking changes and examples of migrating from 2.x to 3.0, please see the migration guide.

Bulk Write

The Rust driver now implements the new Bulk Write specification, which supports performing mixed write operations against multiple namespaces in a minimized number of round-trips to the server. This feature is only available for early testing using MongoDB 8.0 release candidate binaries. This feature is not recommended for use in production until the stable release of MongoDB 8.0.

OIDC Authentication

The Rust driver can now authenticate using an OpenID Connect access token, including support for both the machine and human authentication flows, and automatic token acquisition for Azure and GCP.

Included Changes

Below are a selected list of other changes with user impact; for a full list of changes see this GitHub query.

Breaking Changes

New Features

Improvements

  • chore: bump socket2 to 0.5 (#1020) (thanks attila-lin!)
  • chore: move lazy_static to once_cell (#1022) (thanks attila-lin!)
  • RUST-1631 Always use polling monitoring when running in a FaaS environment (#1030)

Bugfixes

Don't miss a new mongodb release

NewReleases is sending notifications on new releases.