v4.0.0
The MongoDB Node.js team is delighted to announce the major version release 4.0.0 of the MongoDB Node.js Driver!
Release Highlights
We finally did it! The major version release of the MongoDB driver is now generally available! This release represents over a year's worth of effort that couldn't have been done without stellar contributions from the community and our Node.js DBX team. We hope you give it a try and are able to upgrade smoothly! 🎉
The biggest news is our migration to Typescript 🥳 offering first class support of type definitions in the driver itself.
Some cool new MongoDB 5.0 features now supported in the driver are:
- Native support for Time Series Collections
- Time series collections efficiently store sequences of measurements over a period of time. Compared to normal collections, storing time series data in time series collections improves query efficiency and reduces the disk usage for time series data and secondary indexes
- Snapshot reads on secondaries
- Support for read concern level "snapshot" (non-speculative) for read commands outside of transactions, including on secondaries. The snapshot reads on secondaries feature allows users to perform analytics with snapshot isolation on dedicated secondaries, including long running snapshot reads.
Below are only the changes since our last beta release, for the full set of breaking changes look at the upgrade guide here and for the full set of new features, take a look here.
⚠ BREAKING CHANGES (since beta.6)
- NODE-3427: remove md5 hashing from GridFS API (#2899) (a488d88)
- NODE-1797: error when ChangeStream used as iterator and emitter concurrently (#2871) (e0b3afe)
- AND MORE!
Features (since beta.6)
- NODE-3095: add timeseries options to db.createCollection (#2878) (c145c91)
- NODE-3392: enable snapshot reads on secondaries (#2897) (523e05c)
- NODE-3403: define MongoRuntimeError children (#2894) (cb0db49)
- NODE-3410: added MongoRuntimeError (#2892) (ee903cb)
- AND MORE!
Bug Fixes
- NODE-1797: error when ChangeStream used as iterator and emitter concurrently (#2871) (e0b3afe)
- NODE-1843: bulk operations ignoring provided sessions (#2868) (70810d1)
- NODE-3063: fix custom csfle test script (#2884) (d73c80c)
- NODE-3279: use "hello" for monitoring if supported (#2895) (5a8842a)
- NODE-3386: listCollections result type definition (#2866) (c12979a)
- NODE-3413: accept tls=false in mongodb+srv connection strings (#2886) (526c73f)
- NODE-3416: make change stream generic default to Document (#2882) (3d490dc)
- NODE-3430: watch method types on MongoClient and Db (#2900) (17cc291)
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.0
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/4.0/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.