Releases: mongodb/node-mongodb-native
v5.6.0
The MongoDB Node.js team is pleased to announce version 5.6.0 of the mongodb
package!
Release Highlights
Node 20 support
The MongoDB Node.js Driver now supports Node.js 20! 🎉
runCursorCommand
API
We have added the Db#runCursorCommand
method which can be used to execute generic cursor commands. This API complements the generic Db#command
method.
TypeScript support for new time series options
The driver now has TypeScript support for the bucketMaxSpanSeconds
and bucketRoundingSeconds
options which will be available in MongoDB 7.0. You can read more about these options here.
Features
- NODE-5019: add runCursorCommand API (#3655) (4da926e)
- NODE-5071: support additional time series options (#3667) (ccf555d)
Bug Fixes
- NODE-5249: remove strict flag from create collection options (#3677) (be8faaf)
- NODE-5296: construct error messages for AggregateErrors in Node16+ (#3682) (e03178e)
Documentation
We invite you to try the mongodb
library immediately, and report any issues to the NODE project.
v5.5.0
The MongoDB Node.js team is pleased to announce version 5.5.0 of the mongodb
package!
Features
- NODE-4720: Add log messages to CMAP spec (#3645) (b27f385)
- NODE-5004: dont create or drop ecc collections (#3660) (2264fbb)
Bug Fixes
Documentation
We invite you to try the mongodb
library immediately, and report any issues to the NODE project.
v5.4.0
The MongoDB Node.js team is pleased to announce version 5.4.0 of the mongodb
package!
Release Highlights
ChangeStream.tryNext
Typescript fix
We have corrected the tryNext method on ChangeStream to use the TChange
schema generic instead of the untyped Document
interface. This may increase strictness for existing usages but aligns with the rest of the methods on the change stream class to accurately reflect the type returned from the driver.
Deprecations
The db.command()
API has a number of options deprecated that were incorrectly included in the typescript interface the method reportedly accepts. A majority of the options relate to fields that must be attached to the command directly: readConcern
, writeConcern
, and comment
.
Additionally, the collStats helper has been deprecated in favor of using database aggregations to get the same result: https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/
NOTE: This release includes some experimental features that are not yet ready for production use. As a reminder, anything marked experimental is not a part of the stable driver API and is subject to change without notice.
Features and Deprecations
- NODE-5166: bump max wire version for 7.0 (#3659) (561229b)
- NODE-4970: deprecate collStats collection helper (#3638) (325c4bc)
- NODE-5207: deprecate unsupported runCommand options and add spec tests (#3643) (d6d76b4)
Bug Fixes
Documentation
We invite you to try the mongodb
library immediately, and report any issues to the NODE project.
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.