Releases: mongodb/node-mongodb-native
v5.3.0
The MongoDB Node.js team is pleased to announce version 5.3.0 of the mongodb
package!
Features
- NODE-4696: add FaaS env information to client metadata (#3626) (0424080)
- NODE-4774: deprecate cursor forEach (#3622) (8d76a71)
- NODE-4791: deprecate duplicate bulk methods (#3623) (2839e95)
- NODE-4795: deprecate addUser helper (#3624) (53a0aae)
- NODE-5188: add alternative runtime detection to client metadata (#3636) (2a26de3)
- NODE-5189: deprecate tcp keepalive options (#3621) (cc7c75a)
Bug Fixes
- NODE-5042: relax SRV record validation to account for a dot suffix (#3633) (ad15881)
- NODE-5171: allow
upsertedId
to be null inUpdateResult
(#3631) (4b5be21) - NODE-5201: prevent warning when default value for deprecation option is used (#3646) (e7f6e4e)
Documentation
We invite you to try the mongodb
library immediately, and report any issues to the NODE project.
v4.16.0
The MongoDB Node.js team is pleased to announce version 4.16.0 of the mongodb
package!
Features
- NODE-5159: add FaaS env information to client metadata (#3639) (e0b20f1)
- NODE-5199: add alternative runtime detection to client metadata (#3647) (fba16ad)
Bug Fixes
- NODE-5161: metadata duplication in handshake (#3628) (b790142)
- NODE-5200: relax SRV record validation to account for a dot suffix (#3640) (4272c43)
Documentation
We invite you to try the mongodb
library immediately, and report any issues to the NODE project.
v5.2.0
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
- NODE-3998: metadata duplication in handshake (#3615) (6d894d6)
- NODE-4518: error message with invalid authMechanism is provided (#3597) (1a16b7e)
- NODE-4854: set timeout on write and reset on message (#3582) (4a7b5ec)
- NODE-5106: prevent multiple mongo client connect()s from leaking topology (#3596) (eb836bb)
- Thank you @clemclx for contributing this fix! π
- NODE-5126: find operations fail when passed an ObjectId as filter (#3604) (2647b61)
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/5.2/
- Changelog: HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v4.15.0
The MongoDB Node.js team is pleased to announce version 4.15.0 of the mongodb package!
Features
Bug Fixes
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/4.15/
- Changelog: HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v5.1.0
The MongoDB Node.js team is pleased to announce version 5.1.0 of the mongodb
package!
Release Highlights
Support for JavaScript bigint
s in the driver
The driver now supports automatic serialization of JavaScript bigint
s to BSON.Long
s. 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
- NODE-3445: add support for AssumeRoleWithWebIdentity in aws authentication (#3556) (e8a30b1)
- NODE-4877: Add support for useBigInt64 (#3519) (917668c)
- NODE-5050: support GCP automatic credential fetch for CSFLE (#3574) (722a4a6)
Bug Fixes
- NODE-5044: Write Concern 0 Must Not Affect Read Operations (#3541) (#3575) (10146a4)
- NODE-5052: prevent cursor and changestream close logic from running more than once (#3562) (71d0d79)
- NODE-5064: consolidate connection cleanup logic and ensure socket is always closed (#3572) (e544d88)
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/5.1/
- Changelog: HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v5.0.1
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
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/5.0/
- Changelog: HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v4.14.0
The MongoDB Node.js team is pleased to announce version 4.14.0 of the mongodb package!
Deprecations
Bug Fixes
- NODE-4999: Write Concern 0 Must Not Affect Read Operations (#3541) (ddfc2b9)
- NODE-5026: revert "ensure that MessageStream is destroyed when connections are destroyed" (#3551) (c4da623)
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/4.14/
- Changelog: HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v5.0.0
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
- NODE-4522: remove callback support (#3499)
- NODE-4817: remove legacy logger (#3518)
- NODE-4867: adopt BSON v5 (#3490)
- NODE-4738: remove dot notation support by default (#3520)
- NODE-4950: remove bson-ext import (#3523)
- NODE-4756: ok 1 with write concern failure event changes (#3525)
- NODE-4034: make internal bulk result private (#3515)
- NODE-4751: drop support for client encryption < 2.3.0 (#3521)
- NODE-4684: remove collection insert, update, remove methods (#3500)
- NODE-4924: remove mapReduce collection helper (#3511)
- NODE-4925: remove deprecated options and types (#3513)
- NODE-3818: remove slaveOk options (#3503)
- NODE-3695: remove lastop and optime from bulk result (#3504)
- NODE-3489: remove cursor close options (#3505)
- NODE-4598: close cursor on early loop break (#3502)
- NODE-3482: remove unref (#3494)
- NODE-4521: remove custom promise library support (#3498)
- NODE-4898: aws credential providers now optional peerDependency (#3497)
- NODE-4436: update minimum supported node version (#3496)
- NODE-4899: support only snappy 7 or later (#3491)
Features
- NODE-5016: compile ts with target es2020 (#3545) (def266a)
- NODE-3482: remove unref (#3494) (556812f)
- NODE-3489: remove cursor close options (#3505) (88c03a1)
- NODE-3695: remove lastop and optime from bulk result (#3504) (8900d40)
- NODE-3818: remove slaveOk options (#3503) (2e28009)
- NODE-4034: make internal bulk result private (#3515) (ebac1f5)
- NODE-4436: update minimum supported node version (#3496) (cca5362)
- NODE-4509: send 1 with hello commands (#3508) (cc8ea1d)
- NODE-4521: remove custom promise library support (#3498) (af36ebb)
- NODE-4522: remove callback support (#3499) (52853ff)
- NODE-4598: close cursor on early loop break (#3502) (30c0aee)
- NODE-4684: remove collection insert, update, remove methods (#3500) (14427d1)
- NODE-4738: remove dot notation support by default (#3520) (26145df)
- NODE-4751: drop support for client encryption < 2.3.0 (#3521) (3dae6da)
- NODE-4756: ok 1 with write concern failure event changes (#3525) (fee783c)
- NODE-4767: Change abstract cursor return type (#3531) (410ef30)
- NODE-4817: remove legacy logger (#3518) (28c7cdd)
- NODE-4867: adopt BSON v5 (#3490) (b850868)
- NODE-4898: aws credential providers now optional peerDependency (#3497) (b9e4c7c)
- NODE-4899: support only snappy 7 or later (#3491) (21db1a9)
- NODE-4924: remove mapReduce collection helper (#3511) (10d757a)
- NODE-4925: remove deprecated options and types (#3513) (8f8ea45)
- NODE-4950: remove bson-ext import (#3523) (1470115)
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/5.0/
- Changelog: HISTORY.md
We invite you to try the mongodb
library and report any issues to the NODE project.
v5.0.0-alpha.0
π§ 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
The MongoDB Node.js team is pleased to announce version 4.13.0 of the mongodb package!
Features
Bug Fixes
- NODE-4447: disable causal consistency in implicit sessions (#3479) (6566fb5)
- NODE-4834: ensure that MessageStream is destroyed when connections are destroyed (#3482) (8338bae)
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/4.13/
- Changelog: HISTORY.md
We invite you to try the mongodb driver immediately, and report any issues to the NODE project.