Skip to content

Releases: mongodb/js-bson

v4.5.4

03 Nov 19:31
0aa8967
Compare
Choose a tag to compare

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

Release Highlights

This release notably includes a fix to the ObjectId constructor ensuring correct handling of invalid input.

Bug Fixes

Documentation

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

v4.5.3

05 Oct 20:24
6894bae
Compare
Choose a tag to compare

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

Release Highlights

This release includes a few minor changes for spec compliance, primarily around validation, as detailed below:

Bug Fixes

Documentation

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

v4.5.2

14 Sep 17:31
71c6513
Compare
Choose a tag to compare

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

Release Highlights

Some APIs were marked internal that should've been public. We've also add toString methods to our Int32 and Double classes that wrap Javascript's Number.toString() method.

Additionally a bug in Decimal128 was corrected where the representation string was wrongly used to find the significant digits. This impacted negative numbers of pattern -0.00XX.

Bug Fixes

Documentation

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

v4.5.1

24 Aug 15:42
6dcd46e
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.5.1 of the bson module!

In react native environments there was an issue where the bundler attempted to import the Node.js polyfill for 'util'.
We no longer depend on the package.

Bug Fixes

Documentation

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

v4.5.0

19 Aug 19:19
5396ab3
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.5.0 of the bson module!

Release Highlights

The Timestamp constructor can now be called with a more convenient object parameter: new Timestamp({ t: number, i: number }); the existing new Timestamp(increment, timestamp) option has been deprecated.

Furthermore, this minor version significantly improves deserialization performance for buffer inputs and corrects an issue with our ESM bundles resulting from a reference to global which does not exist in web environments.

Features

Bug Fixes

Documentation

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

v4.4.1

06 Jul 17:37
d92de12
Compare
Choose a tag to compare

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

Release Highlights

This patch addresses the bugs listed below. Most notably our EJSON API now correctly stringifies Infinity and NaN doubles in relaxed mode. Relaxed mode is intended for human readable JSON while non-relaxed or canonical mode can be used for data serialization since it will preserve the original BSON type. Double check you are using the correct format for your use case.

Bug Fixes

Documentation

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

v4.4.0

18 May 19:56
fc9fb5d
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.4.0 of the bson module!

Release Highlights

This release of the BSON library brings some additional convenience to our Decimal128 and Long classes.
Users can now specify the construction of these types as shown below:

const longFromBigInt = new Long(23n)
const d128FromString = new Decimal128('4.23')

Here is the new API specification:

  • [new] Decimal128(string)
  • [new] Long(string[, unsigned])
  • [new] Long(bigint[, unsigned])

Thanks so much to @addaleax to contributing a number of the fixes listed below! 🚀

Features

Bug Fixes

Documentation

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

4.3.0

06 Apr 16:29
f60c404
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.3.0 of the bson module!

Release Highlight

UUID Support

With this feature release we are introducing improved support for UUID usage in BSON.
UUIDs in BSON are still a subset of Binary so there is a translation that must occur to use UUIDs in BSON documents.

For example:

// import { UUID, serialize, deserialize } from 'bson'
const { UUID, serialize, deserialize } = require('bson')

const myId = new UUID();
const bsonBuffer = serialize({ myId: myId.toBinary() })
const bsonResult = deserialize(bsonBuffer)
myId.equals(bsonResult.myId.toUUID()) // true!

Full API documentation for the new class will be available here soon after this release.

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project. A special thanks to @steffenagger for his contribution to the library!

1.1.6

16 Mar 14:43
6fc7a87
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 1.1.6 of the bson module!

The BSON library was written prior to the invention of the BigInt type in Javascript ecosystem.
As a result the library was not able to serialize the type properly and silently failed to correctly maintain the bigint value.
With this update, the library will now throw an error if it detects a bigint value.
However, we've also added to/fromBigInt helper methods to the long class, please note that numbers will be clamped to int64 bit width.

const bytes = BSON.serialize({ myBigNumber: Long.fromBigInt(23n) })
const doc = BSON.deserialize(bytes)
doc.myBigNumber.toBigInt() === 23n // true

New Feature

  • [NODE-2378] - Return error when failing to serialize bigint type and add Long class helpers

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!

4.2.3

02 Mar 17:11
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.2.3 of the bson module!

With this version, inspecting BSON objects produces the exact code to instantiate them.

Bug Fixes

  • [NODE-2947] - Inspection method for Binary does not yield same result when evaluated
  • [NODE-3064] - Fix BSON type classes being called without new
  • [NODE-3069] - Cannot use bson package in a webworker.

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.
Thanks very much to all the community members who contributed to this release!