Skip to content

Releases: mongodb/js-bson

v5.0.1

16 Feb 19:00
b6a15b5
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 5.0.1 of the bson package!

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

v5.0.0

31 Jan 19:26
ddb7ec8
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 5.0.0 of the bson package!

Release Highlights

BSON v5 is out and ready to rumble!

The focus of this release was to modernize our library's approach to delivering a unified cross-platform JavaScript experience.
We no longer support EOL Node.js versions, so the new minimum requirement for the library is v14.20.1 or later.
With ES modules no longer experimental and top-level await available, BSON now offers a native ESM bundle that works in Node.js and the browser in addition to the existing CommonJS format.

Remove reliance on Node.js Buffer

Our main improvement centers around the code's use of Uint8Array on the web and Buffer in Node.js.
By pulling out all the byte-by-byte helpers needed to parse and create BSON documents we were able to accomplish the original vision of the Node.js project: true isomorphism (almost!). Our ES module build of the library is runnable in Node.js and the browser, without shims or polyfills. We are so excited for this "write once, run everywhere" future!

The Remove reliance on Node.js Buffer section in the migration guide provides more detail.

Use BigInt with BSON and EJSON

Speaking of modernization, we are delighted to announce support for BigInt as a native way to represent and interact with BSON int64s!

JavaScript introduced an infinite precision integer type called BigInt in 2018. BSON 5.0 supports Nodejs 14+, which enables us to use it as an alternate numeric representation for BSON Longs. You can start sending BigInts down into BSON right away: BSON.serialize and EJSON.stringify understand how to convert them into BSON Long and EJSON's $numberLong format.

Returning BigInts is not enabled by default, however this can be accomplished by adding the useBigInt64: true flag in BSON.deserialize or EJSON.parse. For more information on how we transform BigInt’s to 64-bit Integers see the abstract ToBigInt64 operation.

Note: Full support for this feature is not going to be available in the driver v5.0.0 release, we are intending to make it available in the first feature release after 5.0.0

Upgrade today!

We have a detailed migration guide that provides more context on the changes listed below.

We hope you love BSON as much as we do. 💚 🧑‍💻

⚠ BREAKING CHANGES

Features

Use BigInt with BSON and EJSON

Other Features

Removals and Breaking Fixes

Bug Fixes

Documentation

We invite you to try the bson library and report any issues to the NODE project.

v5.0.0-alpha.3

20 Jan 15:04
8bba395
Compare
Choose a tag to compare
v5.0.0-alpha.3 Pre-release
Pre-release

🚧 Testing Build Only

This alpha build is intended for internal testing only. Adopt at your own risk.

Changes listed in HISTORY.md.

5.0.0-alpha.2 diff v5.0.0-alpha.3 (2023-01-20)

v5.0.0-alpha.2

10 Jan 21:43
ff249e9
Compare
Choose a tag to compare
v5.0.0-alpha.2 Pre-release
Pre-release

🚧 Testing Build Only

This alpha build is intended for internal testing only. Adopt at your own risk.

Changes listed in HISTORY.md.

5.0.0-alpha.1 diff v5.0.0-alpha.2 (2023-01-10)

v4.7.2

10 Jan 20:49
c3fc5df
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version v4.7.2 of the bson package!

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

v4.7.1

05 Jan 15:16
5465c33
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version v4.7.1 of the bson package!

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

v5.0.0-alpha.1

19 Dec 18:14
7596086
Compare
Choose a tag to compare
v5.0.0-alpha.1 Pre-release
Pre-release

🚧 Testing Build Only

This alpha build is intended for internal testing only. Adopt at your own risk.

Changes listed in HISTORY.md.

5.0.0-alpha.0 diff v5.0.0-alpha.1 (2022-12-19)

v5.0.0-alpha.0

19 Dec 16:18
c0ce081
Compare
Choose a tag to compare
v5.0.0-alpha.0 Pre-release
Pre-release

🚧 Testing Build Only

This alpha build is intended for internal testing only. Adopt at your own risk.

Changes listed in HISTORY.md.

5.0.0-alpha.0 diff 4.7.0 (2022-12-16)

v4.7.0

18 Aug 17:25
853bbb0
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.7.0 of the bson package!

Release Highlights

This release adds automatic UUID support. Now when serializing or deserializing BSON you can work directly with the UUID type without explicit conversion methods. The UUID class is now a subclass of binary so all existing code will continue to work (including the explicit conversion methods .toUUID/.toBinary). The same automatic support for UUID is also present in EJSON .parse/.stringify.

Take a look at the following for the expected behavior:

const document = BSON.deserialize(bytes)
// { uuid: UUID('xxx') }
BSON.serialize(document)
// Buffer < document with uuid (binary subtype 4) >

Special thanks to @aditi-khare-mongoDB for all her hard work on this feature!! 🎉

Features


Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

v4.6.5

07 Jul 16:21
32f5f2c
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.6.5 of the bson package!

Release Highlights

Along with some other bug fixes listed below in this release we've fixed the float parser logic for both deserialize and serialize to use JS Dataview APIs. The most delightful part of this change is an improvement to performance of serializing 64-bit floats. 🎉 🐎

- cpu: Apple M1
- cores: 8
- os: darwin
- ram: 16GB
- iterations: 1,000,000
testing: Double Serialization

current           - v 4.6.5 - avg 0.00024913ms
previous release  - v 4.6.4 - avg 0.00036335ms
previous major    - v 1.1.6 - avg 0.00036459ms

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.