Releases: mongodb/node-mongodb-native
v4.2.1
The MongoDB Node.js team is pleased to announce version 4.2.1 of the mongodb package!
Release Highlights
This release fixes an issue with the dbName being overridden by the authSource option. Additionally, we have ensured that cursors re-run server selection when fetching additional batches, which should reduce issues encountered in long running function as a service environments.
Bug Fixes
- NODE-2370: correct a return type of hasNext() (#3058) (b6a63df)
- NODE-3627: Enable flexible BSON validation for server error key containing invalid utf-8 (#3054) (7a507f0)
- NODE-3648: run get more ops through server selection (#3030) (268e211)
- NODE-3767: don't delete dbName if authSource is provided (#3055) (0a830e2)
- NODE-3770: Filter type uses WithId on the schema (#3053) (307d623)
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.2
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/main/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v4.2.0
Release Highlights
This release includes a number of features we’re happy to announce. You can now run aggregation pipelines that write write to a MongoDB collection using $out and $merge stages on secondaries! We’ve added an option to limit the number of hosts the driver will connect to when using SRV DNS lookups to manage your host addresses. And lastly, the authorizedCollection option is now usable on the db.listCollections() function.
Additionally, in this release, we’ve marked collection.mapReduce() as deprecated. The same functionality can be replicated in the much more flexible aggregation pipeline. Visit Map-Reduce to Aggregation Pipeline to learn more.
The minimum supported MongoDB version is 3.6. Attempts to connect to a MongoDB server older than 3.6 will result in an error.
Please take note of the MongoDB Software Lifecycle Schedules for timeframes of supported server versions.
Features
- NODE-3083: support aggregate writes on secondaries (#3022) (f696909)
- NODE-3446: deprecate mapReduce command (#3036) (b6c73bf)
- NODE-3467: implement srvMaxHosts, srvServiceName options (#3031) (1f8b539)
- NODE-3469,NODE-3615,NODE-3507: update min and max wire versions (#3014) (2a78d5a)
- NODE-3691: make time series options granularity type strict (#3005) (98017f9)
- NODE-3692: make change stream events typing more generic (#3034) (d5ae78e)
- NODE-3728: Allow to pass
authorizedCollectionsoption to thedb.listCollectionsmethod (#3021) (e1234a7) - NODE-3729: add withId to default return type for collection.find and collection.findOne (#3039) (52520aa)
Bug Fixes
- NODE-3116: reschedule unreliable async interval first (#3006) (33886a7)
- NODE-3344: allow setting
defaultTransactionOptionswith POJO rather than ReadConcern instance (#3032) (53b3164) - NODE-3515: do proper opTime merging in bulk results (#3012) (43300c3)
- NODE-3668: compile error with OptionalId on TS 4.5 beta (#3004) (ee7f095)
- NODE-3726: add optional option overloads of Db's createCollection function (#3019) (c3149e1)
- NODE-3727: add overloads for BulkOperationBase's execute function (#3018) (216d194)
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.2
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/main/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v4.1.4
Release Highlights
This release includes a couple of bug fixes as noted below:
Bug Fixes
- NODE-3515: do proper opTime merging in bulk results (#3012) (43300c3)
- NODE-3668: compile error with OptionalId on TS 4.5 beta (#3004) (ee7f095)
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.1
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.1/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v3.7.3
The MongoDB Node.js team is pleased to announce version 3.7.3 of the mongodb package!
What's Changed
Full Changelog: v3.7.2...v3.7.3
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/3.7
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.7/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v4.1.3
The MongoDB Node.js team is pleased to announce version 4.1.3 of the mongodb package!
Release Highlights
This release includes a couple of TypeScript fixes as noted below:
Bug Fixes
- NODE-3609: correct listDatabases return type (#2986) (a8e9938)
- NODE-3624: Incorrect default aggregation generic type (#2987) (440517e)
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.1
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.1/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v3.7.2
The MongoDB Node.js team is pleased to announce version 3.7.2 of the mongodb package!
Release Highlights
This release contains a fix for optional require of dependencies on yarn berry.
Bug Fixes
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/3.7
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.7/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v4.1.2
The MongoDB Node.js team is pleased to announce version 4.1.2 of the mongodb package!
Release Highlights
This release addresses a number of bug fixes, please peruse the list below for more information on each fix.
Bug Fixes
- NODE-3434: errInfo should be exposed on bulk write (#2977) (6b3c161)
- NODE-3467: allow object type for aggregate out helper (#2971) (cd603e8)
- NODE-3487: check for nullish aws mechanism property (#2951) (78ec0dd)
- NODE-3559: incorrect GridFS stream type (#2981) (3915ea8)
- NODE-3567: correct typing on aggregation out helper (#2967) (a299a0b)
- NODE-3574: reintroduce ObjectID export (#2965) (2291119)
- NODE-3585: MongoClientOptions#compressors has incorrect type (#2976) (f1b896d)
- NODE-3591: tlsCertificateKeyFile option does not default cert (#2979) (6d42267)
- NODE-3599: incorrect indexes return type (#2980) (122b9f3)
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.1
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.1/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v3.7.1
The MongoDB Node.js team is pleased to announce version 3.7.1 of the mongodb package!
Release Highlights
This release contains an internal improvement that makes our monitor utilize the new hello handshake for monitoring when available.
Features
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/3.7
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/3.7/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v3.7.0
The MongoDB Node.js team is pleased to announce version 3.7.0 of the mongodb package!
Release Highlights
Versioned API
Versioned API is a new feature in MongoDB 5.0 that allows user-selectable API versions, subsets of MongoDB server semantics, to be declared on a client. During communication with a server, clients with a declared API version will force the server to behave in a manner compatible with the API version. Declaring an API version on a client can be used to ensure consistent responses from a server, providing long term API stability for an application. The declared API version is applied to all commands run through the client, including those sent through the generic RunCommand helper. Specifying versioned API options in the command document AND declaring an API version on the client is not supported and will lead to undefined behavior.
Declare an API version on a client
// Declare API version "1" for the client
client = new MongoClient(uri, { serverApi: { version: '1' } });
cursor = client.db('database').collection('coll').find(...);Strict mode
Declaring a strict API version will cause the MongoDB server to reject all commands that are not part of the declared API version. This includes command options and aggregation pipeline stages. For example, the following find call would fail because the tailable option is not part of version 1:
// Declare API version "1" for the client, with strict on
client = new MongoClient(uri, { serverApi: { version: '1', strict: true } });
// Fails with an error
cursor = client.db('database').collection('coll').find({ ... }, { tailable: true });Deprecation Errors
The deprecationErrors option can be used to enable command failures when using functionality that is deprecated from version 1. Note that at the time of this writing, no deprecations in version 1 exist.
// Declare API version "1" for the client, with deprecationErrors on
client = new MongoClient(uri, { serverApi: { version: '1', deprecationErrors: true } });
// Note: since API version "1" is the initial version, there are no deprecated commands to provide as an example yet.Features
Bug Fixes
- NODE-3377: driver should allow arbitrary explain levels (#2961) (96c8ab4)
- NODE-3463: pass explain error through to callback (#2949) (e5975af)
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/3.7/api/
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/v3.7.0/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
v3.6.12
The MongoDB Node.js team is pleased to announce version 3.6.12 of the mongodb package!
Bug Fixes
- NODE-3487: check for nullish aws mechanism property (#2957) (5902b4c)
- NODE-3528: add support for snappy v7 (#2947) (54f5c2d)
Documentation
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/3.6/api/
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/v3.6.12/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.