github mongodb/js-bson v7.2.0

14 hours ago

7.2.0 (2026-01-29)

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

Release Notes

EJSON now supports ignoreUndefined

serialize supports an option, ignoreUndefined, which instructs the serializer to skip any keys whose values are undefined.

This option has been added to EJSON:

> EJSON.stringify({ a: undefined }, { ignoreUndefined: true });
'{}'
> EJSON.stringify({ a: undefined }, { ignoreUndefined: false });
'{"a":null}'
> EJSON.serialize({ a: undefined }, { ignoreUndefined: true });
{}
> EJSON.serialize({ a: undefined }, { ignoreUndefined: false });
{ a: null }

This option defaults to false.

Buffer.copy() now present in ByteUtils

ByteUtils now contains a copy() method, we behaves identically to Nodejs' Buffer.copy() method.

Features

Documentation

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

Don't miss a new js-bson release

NewReleases is sending notifications on new releases.