Skip to content

Releases: mongodb/bson-rust

v3.0.0

25 Aug 13:33
v3.0.0
69f82fb
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v3.0.0 release of the bson crate.

Highlighted Changes

3.0 updates several APIs in backwards-incompatible ways; in most cases these changes should require only minor updates in application code.

Most notably:

  • Unified Error Hierarchy: 3.0 adds the bson::error::Error type, with fields for values common across errors like message or associated key and a kind enum that provides granular root cause information.
  • &CStr: The bson crate now provides types that directly model the BSON spec "cstring" type, removing a potential source of panic!s and allowing validation at either run-time or compile-time for constant strings.
  • Optional serde: Integration with serde is now an optional feature; in support of this, the API has been updated to clarify where methods are for encoding (directly converting Rust BSON values into BSON bytes) or for serialization (converting arbitrary Rust structs to BSON values or bytes via the serde crate).

For detailed information on breaking changes and code examples, please see the migration guide.

Release Notes

Impactful changes are listed below; for a full list of changes see this GitHub query.

Breaking Changes

  • RUST-1906 Remove human readable options (#531)
  • RUST-1380 Drop support for uuid 0.8 (#534)
  • RUST-2169 Clean up and future-proof features (#544)
  • RUST-1887 Convince append to be more accepting (#541)
  • RUST-1960 Make large-dates time feature optional (#546)
  • RUST-1406 Add crate-wide error types, convert value access errors (#551)
  • RUST-1406 Convert raw errors to standard error type (#552)
  • RUST-1998 Remove lossy utf8 as a decoder option (#550)
  • RUST-1869 Rename RawElement::len to RawElement::size (#557)
  • RUST-1992 Make serde an optional feature (#554)
  • RUST-1406 Add type-specific errors to standard error type (#555)
  • RUST-1406 Convert serde errors to standard error type (#562)
  • RUST-1887 Make BindRawBsonRef a little more user-friendly (#565)
  • RUST-1748 Convert serde helpers to serde_with::(De)SerializeAs implementations for some converters between ObjectId, String, and DateTime (#559)
  • RUST-1992 Introduce the &CStr and CString types for keys and regular expressions (#563)
  • RUST-2241 Convert panic from malformed input to error (#568)
  • RUST-2240 Move serde_json API behind a feature flag (#567)
  • RUST-1748 Convert unsigned serde helpers to use serde_conv (#575)
  • RUST-1748 Convert UUID serde helpers to use serde_conv (#579)
  • RUST-2228 Normalize conversions between raw types and base crate types (#580)
  • RUST-1998 Remove now-redundant to_document_utf8_lossy method (#592)

New Features

Improvements

v2.15.0

20 May 16:54
v2.15.0
f6f1630
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.15.0 release of the bson crate.

Full Release Notes

This release adds a contributed uncapped_max_size feature; when enabled, this increases the maximum size of a document from 16 MB to 2 GB.

New Features

  • add uncapped_max_size feature to allow increasing max BSON size (#528) (thanks @Trevader24135!)

v2.14.0

13 Mar 19:04
ff8742e
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.14.0 release of the bson crate.

Highlighted Changes

This release adds:

  • the bson::binary::Vector type, providing efficient support for including
    densely packed arrays of numeric values in BSON documents,
  • functions to DateTime to add milliseconds and Duration,
  • Index impls for Bson and Document, allowing convenient shorthand element lookup.

This release also updates the MSRV to 1.81.

Full Release Notes

New Features

  • RUST-622 Add document square bracket indexing (#503)
  • Add functions to DateTime to add milliseconds and Duration (#506) (thanks @tyilo!)
  • RUST-2003 Binary vector subtype support (#513)

Improvements

Bugfixes

v2.13.0

19 Sep 16:12
401f638
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.13.0 release of the bson crate.

Highlighted Changes

This release introduces a utility type for deserializing from UTF-8 lossy BSON bytes.

Full Release Notes

New Features

  • RUST-2023 Add wrapper type for utf-8 lossy deserialization (#497)

v2.12.0

11 Sep 17:38
8e0fb3b
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.12.0 release of the bson crate.

Highlighted Changes

This release was largely driven by external contributions!

  • An optional implementation of Hash and Eq for the Bson family of types
  • ObjectId::from_parts, allowing direct construction of an ObjectId from its component values
  • Helpers for serializing Option<chrono::DateTime<_>> as Option<bson::DateTime>
  • A fix for a panic when parsing specific malformed input data into a Decimal128

We've also added optional (off by default) integration with the serde_path_to_error crate, which
provides paths to the precise point of failure for deserialization of nested data structures.

Full Release Notes

New Features

Improvements

  • RUST-1773 Merge duplicate extjson map parsing between OwnedOrBorrowedRawBsonVisitor and SeededVisitor

Bugfixes

  • RUST-2028 Fix Decimal128 panic when parsing strings w/o a char boundary at idx 34 (thanks @arthurprs!)

v2.11.0

05 Jun 14:32
0b2ffe8
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.11.0 release of the bson crate.

Highlighted Changes

This release introduces the HumanReadable helper type; this provides more flexible control than the human_readable option, which is now deprecated.

Full Release Notes

New Features

Bugfixes

  • minor: fix lifetime of RawElement::key (#473)
  • RUST-1933: Support deserializing $uuid extended JSON syntax (#474)

v2.10.0

02 Apr 18:28
12eb662
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.10.0 release of the bson crate.

Highlighted Changes

This release adds several bugfixes and the RawDocumentBuf::append_ref method, providing a method equivalent to append for borrowed data. This can be useful for avoiding the need for intermediate buffers when the source data is borrowed.

Full Release Notes

New Features

Bugfixes

  • RUST-1850 Fix a fuzzer failure (#460)
  • fix: access iterators from RawDocument without needing to convert to RawDocumentBuf (#462) (thanks @tychoish!)
  • fix: export RawElement type (#461) (thanks @tychoish!)
  • RUST-1892 Fix timestamp [de]serialization on big-endian machines (#465)
  • RUST-1899 Fix UUID string deserialization (#468)

v2.9.0

25 Jan 19:52
38ffff5
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.9.0 release of the bson crate.

Highlighted Changes

This release adds several externally contributed improvements!

  • A new RawIter type that iterates over elements in a document without deserializing them,
  • An improvement to the doc and bson macros (and their raw counterparts) that allows using types that implement Into<Bson> or Into<RawBson>,
  • An impl of From<&mut T> for Bson for types that implement Into<Bson>,
  • A smaller dependency tree thanks to updating the indexmap crate,
  • And a fix for the serde_with 3.x support for the Uuid type.

Full Release Notes

New Features

Improvements

Bugfixes

v2.8.1

12 Dec 17:09
5b2e73b
Compare
Choose a tag to compare

The MongoDB Rust driver team is pleased to announce the v2.8.1 release of the bson crate.

Highlighted Changes

This release fixes compilation for the wasm32-wasi target, which broke in the 2.8.0 release.

Full Release Notes

Bugfixes

v2.8.0

11 Dec 16:45
e012ed3
Compare
Choose a tag to compare

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