Releases: mongodb/bson-rust
v2.8.0
The MongoDB Rust driver team is pleased to announce the v2.8.0 release of the bson crate.
Highlighted Changes
This release adds optimizations to the serde integration that show up to 50% deserialization speed improvement in our benchmarks, as well as a variety of user-submitted fixes.
Full Release Notes
Improvements
- RUST-1132 Implement DeserializeSeed for owned and borrowed raw documents (#433)
- RUST-1780 Bump MSRV to 1.61.0, upgrade ahash to 0.8.5 in
Cargo.lock.msrv(#436) (thanks @stIncMale!) - minor: use random() directly in gen_process_id (#438) (thanks @pdeva!)
Bugfixes
v2.7.0
The MongoDB Rust driver team is pleased to announce the v2.7.0 release of the bson crate.
Highlighted Changes
This release adds optional integration with serde_with 3.x, duration_since methods to DateTime, and updates some dependencies.
Full Release Notes
New Features
- RUST-1677 Add duration_since methods to DateTime (#417)
- RUST-1699 Add serde_with 3.x integration (#422)
Improvements
- update ahash from 0.7.6 to 0.8.3 (#414) (thanks @Liyixin95!)
- move lazy_static to once_cell (#416) (thanks @attila-lin!)
Bugfixes
- RUST-1714 Use serde traits when only serde_with-3 is enabled (#423) (thanks @maximdeclercq!)
v2.6.1
The MongoDB Rust driver team is pleased to announce the v2.6.1 release of the bson crate.
Highlighted Changes
This release updates the documentation for the Decimal128 type to demonstrate conversion to and from human-readable strings.
Full Release Notes
Improvements
- RUST-1617 Update documentation for Decimal128 type
v2.6.0
The MongoDB Rust driver team is pleased to announce the v2.6.0 release of the bson crate.
Highlighted Changes
This release includes support for conversion between human-readable strings and the Decimal128 BSON type. It also adds tests to verify that the Rust BSON library builds on WASM.
Full Release Notes
New Features
Improvements
- minor: improve serde documentation of DateTime and ObjectId (#401)
- RUST-504 Use js timestamps when generating objectids (#406)
Tasks
v2.5.0
The MongoDB Rust driver team is pleased to announce the v2.5.0 release of the bson crate.
Highlighted Changes
This release sees the addition of a wide variety of helper functions, largely focused on making common type conversions more convenient:
Binary::from_base64allows constructing aBinaryvalue from a base64-encoded string without having to use another crate.i64_as_bson_datetimeprovides Serde helpers for representing bsonDateTimevalues as rusti64fields.Binary::as_raw_binaryandRawBinaryRef::to_binaryallow easy interconversion between the parsed and raw slice reference types for binary data.RawBsonandRawDocumentBufnow implementTryFromfor their respective parsed types (BsonandDocument).Document::iter_mutprovides an iterator over mutable references to the containedBsonvalues.
Full Release Notes
New Features
- RUST-1385 Add binary/raw conversions (#370)
- RUST-1480 Add a TryFrom impl for RawBson (#373)
- RUST-1534: implement iter_mut on Document (#382)
- RUST-1540 impl i64_as_datetime (#383)
- RUST-1225 Add base64 string constructor to Binary (#365)
- RUST-1540 Rename i64_as_datetime to i64_as_bson_datetime (#393)
Improvements
- docs(readme): fix broken hyperlink (#375) (thanks satyarohith!)
- RUST-1062 More efficiently serialize array indexes (#384)
- Fix links in the Feature Flags table. (#388) (thanks judy2k!)
- RUST-782 Add hyperlinks for all types in rustdoc (#389)
Tasks
v2.4.0
Description
The MongoDB Rust driver team is pleased to announce the v2.4.0 release of the bson crate.
Highlighted Changes
The following sections detail some of the more important changes included in this release. For a full list of changes, see the Full Release Notes section below.
Support for 1.x of the uuid crate
The bson crate now has a uuid-1 feature that provides an API for interoperation with versions 1.x of the uuid crate, similar to the existing uuid-0_8 feature. Internal usage of uuid now uses 1.x, so downstream crates without a need for 0.8 will no longer transitively depend on both version.
Builder for DateTime values
The DateTime type now provides a builder that allows convenient construction from a given year, month, day, and optionally, an hour, minute, second and millisecond.
Full Release Notes
New Features
- RUST-1305 Add support for version 1.x of the uuid crate to the bson crate
- RUST-1198 Support creating bson::DateTime from a given year/month/date/hour/minute/second/millisecond
Tasks
v2.3.0
Description
The MongoDB Rust driver team is pleased to announce the 2.3.0 release of the bson crate. This release increases the crate's MSRV to 1.53 and makes the crate's dependency on chrono optional.
Full Release Notes
Task
Improvement
v2.2.0
Description
The MongoDB Rust driver team is pleased to announce the v2.2.0 release of the bson crate.
Highlighted Changes
The following sections detail some of the more important changes included in this release. For a full list of changes, see the Full Release Notes section below.
Raw BSON (RUST-284, RUST-1045, RUST-1082, RUST-1109, RUST-1111, RUST-1119)
Both of the existing ways of working with BSON values (the BSON type or using Serde) require parsing the values up-front. This can be a performance bottleneck in certain circumstances; to address this, we've introduced the RawBson, RawDocument, and RawArray types.
These types provide an interface similar to the existing BSON types, but are backed by a buffer of BSON bytes rather than a fully parsed enum or hash map. This enables zero-copy reads with minimal parsing and highly memory-efficient manipulation.
In tradeoff, these types do not provide the full set of operations that the standard ones can, and the performance of element access is O(N) rather than then average O(1) of the parsed types.
Thanks to @jcdyer for contributing the initial implementation!
Full Release Notes
New Features
- RUST-284 Incorporate raw BSON code from rawbson = "0.2.1" in mod raw (#229)
- RUST-1045 Support appending to RawDocumentBuf (#326)
- RUST-1109 Implement rawbson! and rawdoc! macros (#329)
- RUST-1119 Add bson::to_raw_document_buf function (#330)
- RUST-1111 Support deserializing RawBson from Bson (#331)
- minor: raw BSON perf and API improvements (#335)
Bugfixes
v2.2.0-beta.1
Description
The MongoDB Rust driver team is pleased to announce the v2.2.0-beta.1 release of the bson crate. This is the second beta release in preparation for the 2.2.0 stable release, and it contains some bug fixes that were not included in the first beta.
Highlighted Changes
The following sections detail some of the more important changes included in this release. For a full list of changes, see the Full Release Notes section below.
Map types with enum keys (RUST-1243)
This release fixes deserialization of map types using enum values as the keys; in the prior beta release this would fail with an "invalid type: string" error.
Thanks to @George-Miao for reporting this bug!
Length underflow in binary deserialization (RUST-1240)
This release fixes a bug that caused parsing to erroneously continue when reading invalid length values. This bug would not have caused unsafe behavior (all binary buffer access is checked) but could have caused runtime panics or garbage parse results.
Full Release Notes
Bugfixes
v2.2.0-beta
Description
The MongoDB Rust driver team is pleased to announce the v2.2.0-beta release of the bson crate.
Highlighted Changes
The following sections detail some of the more important changes included in this release. For a full list of changes, see the Full Release Notes section below.
Raw BSON (RUST-284, RUST-1045, RUST-1082, RUST-1109, RUST-1111, RUST-1119)
Both of the existing ways of working with BSON values (the BSON type or using Serde) require parsing the values up-front. This can be a performance bottleneck in certain circumstances; to address this, we've introduced the RawBson, RawDocument, and RawArray types.
These types provide an interface similar to the existing BSON types, but are backed by a buffer of BSON bytes rather than a fully parsed enum or hash map. This enables zero-copy reads with minimal parsing and highly memory-efficient manipulation.
In tradeoff, these types do not provide the full set of operations that the standard ones can, and the performance of element access is O(N) rather than then average O(1) of the parsed types.
Thanks to @jcdyer for contributing the initial implementation!
Full Release Notes
New Features
- RUST-284 Incorporate raw BSON code from rawbson = "0.2.1" in mod raw (#229)
- RUST-1045 Support appending to RawDocumentBuf (#326)
- RUST-1109 Implement rawbson! and rawdoc! macros (#329)
- RUST-1119 Add bson::to_raw_document_buf function (#330)
- RUST-1111 Support deserializing RawBson from Bson (#331)
- minor: raw BSON perf and API improvements (#335)