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
- API: https://github.com/mongodb/js-bson#readme
- Changelog: https://github.com/mongodb/js-bson/blob/master/HISTORY.md#change-log
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!