Releases · mongodb/node-mongodb-native · GitHub
July 22, 2025 at 12:00 AMai_discoveryinfo
Product
pnpm
developmenttoolsprogramming
Update Details
Comprehensive information about this update
Full Content
Release Notes
6.18.0 (2025-07-22) The MongoDB Node.js team is pleased to announce version 6.18.0 of the mongodb package! Release Notes New appendMetadata API allows clients to add handshake metadata post construction Driver information such as name, version, and platform are allowed: import { MongoClient } from 'mongodb'; const client = new MongoClient(process.env.MONGODB_URI); client.appendMetadata({ name: 'my library', version: '1.0', platform: 'NodeJS' }); Cursors lazily instantiate sessions In previous versions, sessions were eagerly allocated whenever a cursor was created, regardless of whether or not a cursor was actually iterated (and the session was actually needed). Some driver APIs (FindCursor.count(), AggregationCursor.explain() and FindCursor.explain()) don't actually iterate the cursor they are executed on. This can lead to client sessions being created and never being cleaned up. With this update, sessions are not allocated until the cursor is iterated. Idle connections are now pruned during periods of no activity even when minPoolSize=0 A MongoClient configured with a maxIdleTimeMS and minPoolSize of 0 is advantageous for workloads that have sustained periods of little or no activity because it allows the connection pool to close connections that are unused during these periods of inactivity. However, due to a bug in the ConnectionPool implementation, idle / perished connections were not cleaned up unless minPoolSize was non-zero. With the changes in this PR, the ConnectionPool now always cleans up idle connections, regardless of minPoolSize. ChangeStream event interfaces include a wallTime property This property is available on all types with the exception of reshard collection and refine collection shard key events. Thanks to @qhello for bringing this bug to our attention! CommandSucceededEvent and CommandFailedEvent events now have a databaseName property CommandSucceededEvent and CommandFailedEvent now include the name of the database against which the command
Published At
Tuesday, July 22, 2025
12:00:00 AM
Discovered At
Monday, August 25, 2025
10:25:39 PM
Confidence
1