Skip to content

Releases: mongodb/node-mongodb-native

v5.2.0

04 Apr 18:06
c5db16b
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 5.2.0 of the mongodb package!

Release Highlights

This release includes driver support for automatically obtaining Azure credentials when using automatic client side encryption. You can find a tutorial for using Azure and automatic encryption here: Use Automatic Queryable Encryption with Azure

Additionally, we have a number of minor bug fixes listed below.

NOTE: This release includes some experimental features that are not yet ready for use. As a reminder, anything marked experimental is not a part of the stable driver API and is subject to change without notice.

Features

Bug Fixes

Documentation

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

v4.15.0

04 Apr 17:39
49fa638
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.15.0 of the mongodb package!

Features

Bug Fixes

Documentation

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

v5.1.0

23 Feb 18:58
687f51a
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 5.1.0 of the mongodb package!

Release Highlights

Support for JavaScript bigints in the driver

The driver now supports automatic serialization of JavaScript bigints to BSON.Longs. It also supports deserializing of BSON.Long values returned from the server to bigint values when the useBigInt64 flag is passed as true.

import { MongoClient } from 'mongodb';

(async () => {
  const client = new MongoClient('<YOUR CONNECTION STRING>');
  const db = client.db('test');
  const coll = db.collection('bigints');

  await coll.insertOne({ a: 10n }); // The driver automatically serializes bigints to BSON.Long before being sent to the server

  const docBigInt = await coll.findOne({ a: 10n }, { useBigInt64: true }); // Must provide the useBigInt64 flag to specify that bigints get returned
  console.log(docBigInt);
  // { _id: ObjectId(...), a: 10n }
  const doc = await coll.findOne({ a: 10n }); // Must provide the useBigInt64 flag to specify that bigints get returned
  console.log(doc);
  // { _id: ObjectId(...), a: 10 }
  await client.close();
})()

Features

Bug Fixes

Documentation

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

v5.0.1

07 Feb 18:08
60f4232
Compare
Choose a tag to compare

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

This release reverts a fix that unintentionally caused a leak of internal driver resources.

Bug Fixes

  • NODE-5027: revert "ensure that MessageStream is destroyed when connections are destroyed" (#3552) (2d178d0)

Documentation

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

v4.14.0

07 Feb 18:20
908b3b6
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.14.0 of the mongodb package!

Deprecations

Bug Fixes

Documentation

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

v5.0.0

31 Jan 21:10
1414393
Compare
Choose a tag to compare

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

Release Highlights

Node.js driver v5 emphazises the modernization of our API.

Farewell to Callbacks

Most notably, we have removed support for callbacks in favor of a Promise-only public API.
To ease the migration to a Promise-only approach when using the Node.js driver, callback support is available via the mongodb-legacy package. You can read more about this change in the Optional callback support migrated to mongodb-legacy section of the migration guide.

Dot Notation No Longer Enabled by Default

Version 4.3.0 of the Node.js driver introduced strict type checking on Filter queries that used dot notation. This functionality was enabled by default and proved to be a barrier for users upgrading to later versions of the Node.js v4.x driver. In order to ease the migration to v5.0.0, type strictness on queries that use dot notation has been removed from the CRUD API. The type checking capabilities are still available in an experimental type called StrictFilter. You can read more about this change in the Dot Notation TypeScript Support Removed By Default section of the migration guide.

BSON v5

This release also adopts all the changes in BSON v5.0.0 (see the release notes).
The driver now exports a BSON namespace that also has BSON.EJSON APIs available.
When working in projects where both the driver and bson are used, we recommend importing BSON types (ObjectId, Long, etc.) and BSON APIs from the driver instead of from BSON directly to ensure consistency when serializing and deserializing instances of the BSON types.

Other Notable Changes

@aws-sdk/credential-providers has now been moved to an optional peer dependency.
Consequently, in v5.0.0 or later versions of the driver, the AWS credential provider module must be installed manually to enable the use of the native AWS SDK for authentication.

Collection.insert, Collection.update, and Collection.remove methods have been removed in favor of their non-deprecated counterparts. You can read more about this and other changes in our Driver v5 Migration Guide.

⚠BREAKING CHANGES

Features

Documentation

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

v5.0.0-alpha.0

24 Jan 01:17
4fcae82
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 v4.13.0 (2023-01-23)

v4.13.0

19 Dec 15:41
eb5f651
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.13.0 of the mongodb package!

Features

Bug Fixes

Documentation

We invite you to try the mongodb driver immediately, and report any issues to the NODE project.

v4.12.1

23 Nov 18:52
73e92ce
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.12.1 of the mongodb package!

Release Highlights

This version includes a fix to a regression in our monitoring logic that could cause process crashing errors that was introduced in v4.12.0.

If you are using v4.12.0 of the Node driver, we strongly encourage you to upgrade.

Bug Fixes

Documentation

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

4.12.0

16 Nov 20:45
8254575
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 4.12.0 of the mongodb package!

Release Highlights

ChangeStreams are now AsyncIterators

ChangeStreams are now async iterables and can be used anywhere that expects an async iterable. Notably, change streams can now be used in Javascript for-await loops:

const changeStream = collection.watch();
for await (const change of changeStream) {
  console.log(“Received change: , change);
}

Some users may have been using change streams in for-await loops manually by using a for-await loop with the ChangeStream’s internal cursor. For example:

const changeStream = collection.watch();
for await (const change of changeStream.cursor) {
  console.log(“Received change: , change);
}

The change stream cursor has no support for resumabilty and consequently the change stream will never attempt to resume on any errors. We strongly caution against using a change stream cursor as an async iterable and strongly recommend using the change stream directly.

Server Monitoring Fix When Monitoring Events are Skipped

Version 4.7.0 of the Node driver released an improvement to our server monitoring in FAAS environments by allowing the driver to skip monitoring events if there were more than one monitoring events in the queue when the monitoring code restarted. When skipping monitoring events that contained a topology change, the driver would incorrectly fail to update its view of the topology.

Version 4.12.0 fixes this issue by ensuring that the topology is always updated when monitoring events are processed.

Performance Improvements with Buffering

This release also modifies the data structures used internally in the driver to use linked lists in places where random access is not required and constant time insertion and deletion is beneficial.

External Contributions

Many thanks to @ImRodry for helping us fix the documentation for our deprecated callback overloads in this release!

Features

Deprecations

Bug Fixes

Documentation

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