The MongoDB Node.js team is pleased to announce version 4.8.0 of the mongodb package!
In this release you will now get auto-complete and type safety for nested keys in an update filter. See the example below:
In our last release we made explicitly calling
client.connect() before performing operations optional with some caveats. In this release
client.startSession() can now be called before connecting to MongoDB.
- The only APIs that need the client to be connected before using are the legacy
collection.initializeOrderedBulkOp()builder methods. However, the preferred
collection.bulkWrite()API can be used without calling connect explicitly.
- While executing operations without explicitly connecting may be streamlined and convenient, depending on your use case
client.connect()could still be useful to find out early if there is some easily detectable issue (ex. networking) that prevents you from accessing your database.
- NODE-4078: allow comment with estimated doc count (#3301) (bed1fe3)
- NODE-4267: support nested fields in type completion for UpdateFilter (#3259) (1a9a44c)
- NODE-4125: change stream resumability (#3289) (aa5f97e)
- NODE-4262: make startSession work without a connection (#3286) (89ad7c3)
- Reference: https://docs.mongodb.com/drivers/node/current/
- API: mongodb
- 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.