Skip to content

Releases: mongodb/mongo-rust-driver

v2.8.2

15 Mar 18:55
f424aed
Compare
Choose a tag to compare

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

This release fixes a potential issue when serializing messages.

Full Release Notes

Improvements

  • RUST-1553 Add support for document sequences (OP_MSG payload type 1) (#1009)

Bugfixes

v2.8.1

09 Feb 19:33
Compare
Choose a tag to compare

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

This release fixes two bugs:

  • on-demand KMS credentials wouldn't work with automatic encryption, and
  • initial connection responses from the server could fail to parse under certain circumstances.

Full Release Notes

Bugfixes

  • RUST-1883 Set use_need_kms_credentials_state unconditionally when creating a new ClientState (#1018)
  • RUST-1841 Allow double-valued connectionIds (#1025)

v2.8.0

11 Dec 19:23
5bc56ca
Compare
Choose a tag to compare

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

Highlighted Changes

Search Index Management Helpers

The Collection type now has the create_search_index, create_search_indexes, update_search_index, drop_search_index, and list_search_indexes methods, allowing comprehensive management of search indexes from client code.

Reliability Improvements

More error types will be automatically retried, and retries will avoid mongos backends with network connectivity issues. Also note that the documentation for with_transaction has been updated to clarify error handling requirements to avoid a deadlock.

Included Changes

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

New Features

Improvements

  • RUST-877 Delay replacement document serialization until Operation::build (#942)
  • RUST-1763 deprecate CollectionOptions::human_readable_serialization (#957)
  • RUST-1414 disable causal consistency for implicit sessions (#969)
  • RUST-935 direct retries to different mongos (#968)
  • docs: remove pointless recommendation (#973) (thanks @cailloumajor!)
  • RUST-1780 Bump MSRV to 1.61.0, upgrade ahash to 0.8.5 in MSRV-Cargo.lock (#981) (thanks @stIncMale!)
  • RUST-1676 Simplify GenericCursor by refactoring the GetMoreProvider trait into a generic struct (#983) (thanks @stIncMale!)
  • RUST-1804 Replace async_once with tokio::sync::OnceCell (#992) (thanks @Expyron!)
  • RUST-1786 Make ReadConcernMajorityNotAvailableYet a retryable read error (#996)
  • RUST-1785 Make ExceededTimeLimit a read-retryable error (#997)
  • RUST-1788 Update docs for with_transaction to avoid infinite loop (#998)

Bugfixes

  • RUST-1698 Fix reading gridfs chunks from async-std file stream (#950)
  • RUST-1757 Fix final cursor batch handling (#951)
  • fixing the find or delete serde inconsistency (#948) (thanks @mlokr!)

v2.7.1

01 Nov 16:53
Compare
Choose a tag to compare

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

This release fixes a bug that caused a memory leak in various circumstances.

Full Release Notes

Bugfixes

v2.7.0

27 Sep 17:11
Compare
Choose a tag to compare

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

The Rust driver documentation is now hosted at https://www.mongodb.com/docs/drivers/rust/current/. This documentation includes detailed content about features, runnable examples, troubleshooting resources, and more.

Highlighted Changes

Serialization Behavior Change

When serializing values via serde, the serializer can indicate whether or not the target format is human-readable, allowing types to change behavior based on that. The Rust driver had inadvertently been serializing values given to find_one_and_replace and replace_one as human-readible when all other methods serialize as non-human-readible; this bug is fixed in 2.7.0, with those methods also serializing as non-human-readible.

However, it is potentially possible (if unlikely) that user code may rely on this bug. If your code does rely on human-readable serialization, you can specify that via the new human_readable_serialization field in CollectionOptions.

run_cursor_command

The Rust driver provides the run_command method as a way for users to directly send bson commands to the server; this is particularly useful when the driver does not yet have support for a newly-added server command. However, using this with commands that return a cursor requires re-implementing the logic for cursor iteration, which can be tedious and error-prone. The new run_cursor_command method avoids those problems, directly returning a Cursor using the same iteration logic as other methods.

SDAM Logging

The Rust driver will now log SDAM events when using the tracing-unstable feature.

Client Management

The Client type now provides three additional ways to shape behavior to fit your workload:

  • ClientOptions.max_connecting lets you specify how many "in flight" connections can be established in parallel. This was previously fixed at 2 and defaults to the same value.
  • Client::warm_connection_pool will create new connections to bring the connection pool up to min_pool_size, which can provide more predictable performance in some circumstances.
  • Client::shutdown will cleanly stop background tasks and wait for outstanding handles to be dropped. This is particularly useful when using event handlers that reference external resources, as otherwise those handlers may be invoked in a background task even after the Client has been dropped.

Included Changes

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

New Features

Improvements

Bugfixes

v2.7.0-beta.1

18 Sep 20:01
Compare
Choose a tag to compare
v2.7.0-beta.1 Pre-release
Pre-release

The MongoDB Rust driver team is pleased to announce the v2.7.0-beta.1 release of the mongodb crate, now available for download from crates.io.

Included Changes

Improvements

Bugfixes

v2.7.0-beta

30 Aug 20:36
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.7.0-beta release of the mongodb crate, now available for download from crates.io.

Highlighted Changes

BETA: Serialization Behavior Change

When serializing values via serde, the serializer can indicate whether or not the target format is human-readable, allowing types to change behavior based on that. The Rust driver had inadvertently been serializing values given to find_one_and_replace and replace_one as human-readible when all other methods serialize as non-human-readible; this bug is fixed in 2.7.0-beta, with those methods also serializing as non-human-readible.

However, it is potentially possible (if unlikely) that user code may rely on this bug, so out of an abundance of caution we are releasing this version as a beta. If your code does rely on human-readable serialization, you can specify that via the new human_readable_serialization field in CollectionOptions.

run_cursor_command

The Rust driver provides the run_command method as a way for users to directly send bson commands to the server; this is particularly useful when the driver does not yet have support for a newly-added server command. However, using this with commands that return a cursor requires re-implementing the logic for cursor iteration, which can be tedious and error-prone. The new run_cursor_command method avoids those problems, directly returning a Cursor using the same iteration logic as other methods.

SDAM Logging

The Rust driver will now log SDAM events when using the tracing-unstable feature.

Client Management

The Client type now provides three additional ways to shape behavior to fit your workload:

  • ClientOptions.max_connecting lets you specify how many "in flight" connections can be established in parallel. This was previously fixed at 2 and defaults to the same value.
  • Client::warm_connection_pool will create new connections to bring the connection pool up to min_pool_size, which can provide more predictable performance in some circumstances.
  • Client::shutdown will cleanly stop background tasks and wait for outstanding handles to be dropped. This is particularly useful when using event handlers that reference external resources, as otherwise those handlers may be invoked in a background task even after the Client has been dropped.

Included Changes

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

New Features

Improvements

  • RUST-1433 Propagate original error for some labeled retry errors (#903)
  • minor: improve README.md (#934)
  • upgrade webpki (#935) (thanks @fuchsnj!)

Bugfixes

v2.6.1

16 Aug 00:16
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.6.1 release of the mongodb crate, now available for download from crates.io. This release removes a potential panic from the SessionCursor::with_type method.

Included Changes

Bugfixes

  • RUST-1719 Fix panic after SessionCursor::with_type is called (#928) (thank you @mlokr for this fix!)

v2.6.0

22 Jun 00:24
c33d83a
Compare
Choose a tag to compare

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

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-1421 Implement FromStr for Namespace (#889)
  • RUST-906 Add native support for AWS IAM Roles for service accounts, EKS in particular (#885)
  • RUST-1417 Add support for GCP attached service accounts when using GCP KMS (#877)
  • RUST-1442 On-demand Azure KMS credentials (#872)
  • RUST-1571 Add i64 server ID field to ConnectionInfo (#894)

Improvements

Bugfixes

Tasks

v2.5.0

19 Apr 19:12
Compare
Choose a tag to compare

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

Highlighted Changes

In-Use Encryption: Automatically Create Keys

This release adds the ClientEncryption::create_encrypted_collection helper method, which will automatically create encryption keys as needed when creating a collection with the encrypted_fields option.

Convenient Transactions

This release adds the ClientSession::with_transaction helper method, which will handle automatically creating, retrying, and committing or aborting a transaction.

Included Changes

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

New Features

Improvements

  • RUST-1069 Defer implicit session check out until after connection check out (#811)
  • RUST-1582 Expose collection.client() as public (#822) (Thanks LuisOsta!)
  • RUST-1503 Test csfle against older server versions (#832)
  • RUST-1607: allow uuidRepresentation in connection string (#838) (Thanks terakilobyte!)
  • RUST-1501 Collect FaaS platform metadata (#844)
  • RUST-1585 Do not perform server selection to determine sessions support (#854)

Bugfixes