Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /

Upgrade Major Versions

In this section, you can identify the changes you must make to your application to upgrade your driver to a new version.

Before you upgrade, perform the following actions:

  • Ensure the new driver version is compatible with the MongoDB Server versions your application connects to and the Rust versions your application runs on. To view compatibility information, see the Compatibility page.

  • Address any breaking changes between the current version of the driver your application is using and your planned upgrade version in the Breaking Changes section.

Each Rust driver release has a version number in the format MAJOR.MINOR.PATCH. The Rust driver uses Semantic Versioning (SemVer), which typically means:

  • Breaking changes and removal of deprecated functionality will be done only in major version releases.

  • New functionality might be added using feature flags, which must be enabled via an opt-in configuration change. These feature flags may be added in either major or minor releases.

  • Functionality might be marked as deprecated in either major or minor releases, but will not be removed until the next major release, at the earliest.

  • Patch version releases will contain only non-breaking fixes and security updates.

A breaking change is a modification in a convention or behavior in a specific version of the driver that might prevent your application from working properly if you don't address it before upgrading.

The breaking changes in this section are categorized by the driver version that introduced them. When upgrading driver versions, address all the breaking changes between the current and upgrade versions.

The Rust driver v3.5 release includes the following deprecations:

  • Deprecates specifying AWS authentication in the username and password of your connection string and the AWS_SESSION_TOKEN property. This functionality will be removed in the next major version of the driver. Update your application to use alternative AWS authentication methods. To learn more about AWS authentication, see the MONGODB-AWS Mechanism section of the Authentication guide.

  • Deprecates the socketTimeoutMS option. Use the wTimeoutMS option instead. To learn more about available connection options, see the Connection Options guide.

The Rust driver v3.3 release includes the following breaking changes:

  • Drops support for MongoDB Server version 4.0 and raises the minimum supported version to 4.2. Ensure your MongoDB deployment is running version 4.2 or later before upgrading.

  • Introduces support for version 3.0 of the BSON crate. While the driver uses version 2.15 by default for backwards compatibility, BSON 3.0 includes several backwards-incompatible API changes:

    • Introduces a unified bson::error::Error type that consolidates error handling.

    • Adds &CStr and CString types for BSON keys and regular expressions.

    • Makes serde an optional feature that is disabled by default. Serialization and deserialization functions now have serialize_to or deserialize_from prefixes.

The Rust driver v3.2 release includes the following breaking changes:

  • Increases the Minimum Supported Rust Version to 1.71.1. Ensure your development environment uses Rust version 1.71.1 or later.

The Rust driver v3.1 release includes the following breaking changes:

  • Drops support for MongoDB Server version 3.6 and raises the minimum supported version to 4.0. Ensure your MongoDB deployment is running version 4.0 or later before upgrading.

The Rust driver v3.0 release includes the following breaking changes:

  • Implements a fluent API that changes how you pass options and start sessions:

    • Chain option builder methods directly to method calls instead of passing options struct parameters

    • Chain the session() method to method calls instead of using methods with _with_session suffixes

    • Use the run() method for synchronous operations

  • Removes support for the async-std asynchronous runtime. Update your application to use an alternative runtime such as Tokio.

  • Requires the use of a compat feature if compiled with the no-default-features flag. The rustls and dns-resolution features are now optional.

  • Removes support for the bson-* driver features. Select these features by including bson as a direct dependency in your application instead.

  • Removes support for read and write concern constants. Use helper methods to set ReadConcern and WriteConcern values instead.

  • Adds Send + Sync constraints to the Collection<T> type.

  • Changes the type of ReadPreferenceOptions fields to Option<ReadPreferenceOptions>.

  • Removes the CollectionOptions::human_readable_serialization option. Instead of the CollectionOptions::human_readable_serialization option, use the bson::HumanReadable wrapper type to serialize user data into human-readable form.

  • Renames the comment_bson field to comment for AggregateOptions, FindOptions, and FindOneOptions structs.

Back

Compatibility

On this page