# MongoDB Node.js Driver: what changed from 6 to 7 - Product: MongoDB Node.js Driver (https://whatsnew.fyi/product/mongodb-node-driver) - Vendor: MongoDB - Range: changelog entries numbered after v6.21.0 up to and including v7.6.0, stable releases only - Entries below: 8 releases (newest first) - Resolved: 6 is v6.21.0 and 7 is v7.6.0, the newest stable release of each major we track - Carrying security changes: 0 · CVEs mentioned: 0 · Mentioning breaking changes: 1 · Removing or deprecating something: 4 - Page: https://whatsnew.fyi/product/mongodb-node-driver/compare/6...7 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. ## What changed (56 changes, grouped by kind) ### Added #### v7.6.0 (2026-08-24) - Add kmsConnectCallback option to route KMS requests through an HTTP proxy for CSFLE and Queryable Encryption - Add baseBackoffMS support and update client backpressure backoff configuration #### v7.5.0 (2026-07-07) - Support for Queryable Encryption string queries in MongoDB 9.0 with exact and range-style string matching against encrypted fields #### v7.2.0 (2026-04-20) - Support for MongoDB's Intelligent Workload Management with graceful handling of write-blocking scenarios and optimized connection establishment during high-load conditions - New client option `maxAdaptiveRetries` (default: 2) to configure the maximum number of retries during server overload - New client option `enableOverloadRetargeting` (default: false) to deprioritize servers that return overload errors during retry server selection - Experimental `runtimeAdapters` client option to allow injection of core Node.js APIs for use in alternative runtimes and restricted environments - Support for injecting Node.js `os` module via `runtimeAdapters` - Add `bufferedCount()` method to ChangeStream to return the number of documents remaining in the change stream from the last batch #### v7.0.0 (2025-11-06) - Native support for explicit resource management with Symbol.asyncDispose implementations on MongoClient, ClientSession, ChangeStream and cursors ### Changed #### v7.6.0 (2026-08-24) - Improve performance for MongoDB 9.0's Intelligent Workload Management by only retrying overload errors when expected to improve server conditions - Optimize bulk writes to serialize each document only once instead of processing twice, reducing BSON-encoding CPU usage and event-loop blocking #### v7.5.0 (2026-07-07) - TextOpts API is replaced with StringOpts - TextPreview algorithm is replaced with String #### v7.4.0 (2026-06-25) - Remove experimental tag from Symbol.asyncDispose methods on MongoClient, ClientSession, ChangeStream, and cursors to mark explicit resource management as stable - Send afterClusterTime on writes in causally-consistent sessions to maintain read your own writes guarantee across primary failovers in sharded clusters #### v7.3.0 (2026-06-09) - Bump maxWireVersion to 29 in preparation for MongoDB LTS v9.0 #### v7.2.0 (2026-04-20) - Replace Node-specific Buffer APIs with standard Uint8Array APIs - Replace Node-specific crypto API with standard Web Crypto API `globalThis.crypto` - Implement exponential backoff and jitter in retry loops #### v7.1.0 (2026-02-04) - Driver no longer relies on Node.js util.promisify() API for improved compatibility with alternate runtimes - Driver now explicitly imports node:process instead of relying on global.process - Replace process.arch with os.arch() - Replace process.platform with os.platform() - Replace os.endianness() with BSON.NumberUtils - Replace process.hrtime() with performance.now() - Replace process.nextTick() with queueMicrotask() - withTransaction now applies exponential backoff during transaction retries - Server selection deprioritizes servers during retries - OIDC authentication now supports hosts matching *.mongo.com in its default ALLOWED_HOSTS list #### v7.0.0 (2025-11-06) - Minimum supported Node.js version is now v20.19.0 - TypeScript target has been updated to ES2023 - Driver updated to use bson@7.0.0 and mongodb-connection-string-url@7.0.0 - Minimum version for @mongodb-js/zstd optional peer dependency raised to 7.0.0, dropped support for 1.x and 2.x - Minimum version for kerberos optional peer dependency raised to 7.0.0, dropped support for 2.x - Minimum version for mongodb-client-encryption optional peer dependency raised to 7.0.0, dropped support for 6.x - Updated compatibility for @aws-sdk/credential-providers to ^3.806.0, gcp-metadata to ^7.0.1, and socks to ^2.8.6 - @aws-sdk/credential-providers is now required for MONGODB-AWS authentication - Custom AWS credential provider via AWS_CREDENTIAL_PROVIDER takes highest precedence over other AWS auth methods - Dropping a collection returns false instead of throwing when namespace not found - Aggregate with write concern and explain now throws MongoServerError instead of client-side error ### Fixed #### v7.6.0 (2026-08-24) - Fix ReferenceError: require is not defined when bundling the driver into ESM by using dynamic import for the os module #### v7.5.0 (2026-07-07) - MongoClient.close() now closes checked-out connections on all servers in replica sets and sharded clusters #### v7.3.0 (2026-06-09) - Fix SCRAM authentication for non-Node.js runtimes such as Deno by using explicit UTF-8 string conversion instead of implicit toString() calls on byte arrays #### v7.1.1 (2026-03-24) - Tighten OIDC ALLOWED_HOSTS wildcard matching to require full subdomain/path matches for *. and */ entries, preventing partial suffix matches from being incorrectly accepted - Apply TCP keep-alive and no-delay settings on TLS connections by explicitly calling setKeepAlive() and setNoDelay() on the socket after creation #### v7.1.0 (2026-02-04) - Connection establishment failures no longer clear the pool, preventing unnecessary connection churn in server overload scenarios - OIDC reauthentication now works with promoteValues: false - Aggregations with write stages now correctly respect secondary and secondaryPreferred read preferences due to corrected commonWireVersion initialization #### v7.0.0 (2025-11-06) - All encryption-related errors now subclass MongoError - Fixed typo in error label from PoolRequstedRetry to PoolRequestedRetry ### Removed #### v7.6.0 (2026-08-24) - Support for MongoDB 4.2 or less is removed; the driver will throw an error when connecting to these server versions #### v7.1.0 (2026-02-04) - aws4 package is no longer required for AWS authentication #### v7.0.0 (2025-11-06) - Explicitly provided credentials no longer accepted with MONGODB-AWS authentication in connection strings ### Deprecated #### v7.5.0 (2026-07-07) - prefixPreview, suffixPreview, and substringPreview query types are deprecated and will be removed in a future release #### v7.1.0 (2026-02-04) - RenameCollectionOptions.new_collection option is deprecated and will be removed in a future major release ## Release notes ### v7.6.0 - Date: 2026-08-24 - Version: v7.6.0 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.6.0 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.6.0 - **removed** — Support for MongoDB 4.2 or less is removed; the driver will throw an error when connecting to these server versions - **added** — Add kmsConnectCallback option to route KMS requests through an HTTP proxy for CSFLE and Queryable Encryption - **changed** — Improve performance for MongoDB 9.0's Intelligent Workload Management by only retrying overload errors when expected to improve server conditions - **fixed** — Fix ReferenceError: require is not defined when bundling the driver into ESM by using dynamic import for the os module - **changed** — Optimize bulk writes to serialize each document only once instead of processing twice, reducing BSON-encoding CPU usage and event-loop blocking - **added** — Add baseBackoffMS support and update client backpressure backoff configuration ##### [7.6.0](https://github.com/mongodb/node-mongodb-native/compare/v7.5.0...v7.6.0) (2026-08-21) The MongoDB Node.js team is pleased to announce version 7.6.0 of the `mongodb` package! ##### Release Notes ###### Support for MongoDB 4.2 is removed > [!WARNING] > When the driver connects to a MongoDB server of version 4.2 or less, it will now throw an error. ###### HTTP proxy support for KMS requests in CSFLE and Queryable Encryption In-use encryption can now route KMS requests through an HTTP proxy. Set `kmsConnectCallback` on your `ClientEncryption` or auto-encryption options to control how the driver connects to a KMS host. The callback receives the target `host` and `port` and returns a connected socket (for example, a tunnel opened with HTTP CONNECT); the driver then performs the KMS TLS handshake over that socket using the provider's configured TLS options. This unblocks CSFLE and Queryable Encryption in environments that require an HTTP forward proxy for outbound KMS traffic, which the existing SOCKS5 `proxyOptions` does not cover. ```ts const clientEncryption = new ClientEncryption(keyVaultClient, { keyVaultNamespace, kmsProviders, // Establish the KMS connection through your HTTP proxy; the driver adds TLS. kmsConnectCallback: ({ host, port }) => connectThroughHttpProxy(host, port) }); ``` ###### Improved Intelligent Workload Management Improved performance for MongoDB 9.0's Intelligent Workload Management (IWM) by only retrying overload errors when doing so is expected to not worsen server conditions ###### Bundling the driver into ESM no longer throws `ReferenceError: require is not defined` v7.2.0 introduced the experimental `runtimeAdapters` option and, as part of it, replaced the driver’s static import of Node’s `os` module with a runtime `require('os')`. That works in a CommonJS build, but when the driver is bundled into ESM output (e.g. a Vite/esbuild/rollup server build with `"type": "module"`), there is no `require` in module scope, so constructing a client threw `ReferenceError: require is not defined`. The driver now loads the default `os` adapter through a dynamic `import()` that survives bundling, so `new MongoClient()` works in ESM bundles. CommonJS usage is unchanged, and supplying your own `runtimeAdapters.os` continues to work. ###### Bulk writes serialize each document only once `insertMany` and `bulkWrite` previously processed each document twice - once to measure its size for batch splitting (a full recursive walk via `calculateObjectSize`) and again to serialize it into the command sent to the server. Documents are now serialized a single time and the resulting bytes are reused for both, decreasing the BSON-encoding CPU spent on bulk writes and reducing event-loop blocking during large batches. The improvement is most noticeable with high document counts and documents that have many fields. ###### Features * **NODE-7546:** add HTTP Proxy support for QE & CSFLE ([#5007](https://github.com/mongodb/node-mongodb-native/issues/5007)) ([3366c21](https://github.com/mongodb/node-mongodb-native/commit/3366c21a6311e02f1be91da982f9b93d3cce99a0)) * **NODE-7547:** bump minimum support server/wire versions to '4.4' & '9' respectively ([#4994](https://github.com/mongodb/node-mongodb-native/issues/4994)) ([3d97028](https://github.com/mongodb/node-mongodb-native/commit/3d97028b63c51345aaa2852ed4c467dc21b972bd)) * **NODE-7624:** support baseBackoffMS and update client backpressure backoff ([#5020](https://github.com/mongodb/node-mongodb-native/issues/5020)) ([560837b](https://github.com/mongodb/node-mongodb-native/commit/560837b9a7e76d21cf1baaef894e9301bab0b264)) ###### Bug Fixes * **NODE-7603:** emit dynamic `import('os')` via `tsconfig` ([#4992](https://github.com/mongodb/node-mongodb-native/issues/4992)) ([52f5e61](https://github.com/mongodb/node-mongodb-native/commit/52f5e61c8a439f9284c82f72357c376783f055b4)) ###### Performance Improve _[Truncated at 4000 characters — full notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.6.0]_ ### v7.5.0 - Date: 2026-07-07 - Version: v7.5.0 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.5.0 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.5.0 - **added** — Support for Queryable Encryption string queries in MongoDB 9.0 with exact and range-style string matching against encrypted fields - **changed** — TextOpts API is replaced with StringOpts - **changed** — TextPreview algorithm is replaced with String - **deprecated** — prefixPreview, suffixPreview, and substringPreview query types are deprecated and will be removed in a future release - **fixed** — MongoClient.close() now closes checked-out connections on all servers in replica sets and sharded clusters ##### [7.5.0](https://github.com/mongodb/node-mongodb-native/compare/v7.4.0...v7.5.0) (2026-07-07) The MongoDB Node.js team is pleased to announce version 7.5.0 of the `mongodb` package! ##### Release Notes ###### Support for Queryable Encryption String Query GA in MongoDB 9.0 Queryable Encryption string queries are now available for MongoDB 9.0. Building on the technical preview introduced in earlier releases, this feature lets you run exact and range-style string matching against encrypted fields. As part of the promotion to GA, the API has been renamed: - The `TextOpts` API is replaced with `StringOpts`. - The `TextPreview` algorithm is replaced with `String`. - The `prefix`, `suffix`, and `substring` query types are now generally available. - The `prefixPreview`, `suffixPreview`, and `substringPreview` query types are deprecated and will be removed in a future release. ###### MongoClient.close() now closes in-use connections on all servers Since v6.17.0, `MongoClient.close()` has eagerly closed checked-out (in-use) connections so that in-flight operations are interrupted promptly with a `MongoClientClosedError` instead of holding the client open. However, due to a bug, on replica sets and sharded clusters operations in flight on other servers were not interrupted, and their connections stayed open until the operations completed on their own. Calls to closeCheckedOutConnections() will now ensure all checked out connections are closed across all servers. Thank you to @Nepomuk5665 and @sarthaksoni25 for bringing this to our attention/providing an initial implementation! ###### Features * **NODE-7537:** promote QE string queries (prefix/suffix/substring) ([#4996](https://github.com/mongodb/node-mongodb-native/issues/4996)) ([dc4900c](https://github.com/mongodb/node-mongodb-native/commit/dc4900c36207d70b718c6fc013c5233ceb9f343c)) ###### Bug Fixes * **NODE-7411:** iterate all servers on close ([#4967](https://github.com/mongodb/node-mongodb-native/issues/4967)) ([72c0296](https://github.com/mongodb/node-mongodb-native/commit/72c02969f49ebc239dd15ef3deaf9be15fbbb94f)) ##### Documentation * [Reference](https://docs.mongodb.com/drivers/node/current/) * [API](https://mongodb.github.io/node-mongodb-native/7.5/) * [Changelog](https://github.com/mongodb/node-mongodb-native/blob/v7.5.0/HISTORY.md) We invite you to try the `mongodb` library immediately, and report any issues to the [NODE project](https://jira.mongodb.org/projects/NODE). ### v7.4.0 - Date: 2026-06-25 - Version: v7.4.0 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.4.0 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.4.0 - **changed** — Remove experimental tag from Symbol.asyncDispose methods on MongoClient, ClientSession, ChangeStream, and cursors to mark explicit resource management as stable - **changed** — Send afterClusterTime on writes in causally-consistent sessions to maintain read your own writes guarantee across primary failovers in sharded clusters ##### [7.4.0](https://github.com/mongodb/node-mongodb-native/compare/v7.3.0...v7.4.0) (2026-06-25) The MongoDB Node.js team is pleased to announce version 7.4.0 of the `mongodb` package! ##### Release Notes ###### Explicit resource management is now stable The `Symbol.asyncDispose` methods on `MongoClient`, `ClientSession`, `ChangeStream`, and cursors enable `await using` for automatic cleanup. These methods were introduced as experimental in v6.9.0. Since then, TC39 Explicit Resource Management proposal reached Stage 4 in 2025, and Node.js enabled explicit resource management as a stable feature in Node.js 24, so the experimental flags have been removed from our APIs and the APIs are now officially supported. ###### afterClusterTime now sent on writes in causally-consistent sessions When a session has causal consistency enabled, write operations now include `readConcern.afterClusterTime`, matching the existing read behavior. This maintains the "read your own writes" guarantee across primary failovers in shareded clusters. There are no API changes. ###### Features * **NODE-7634:** remove experimental tag from async dispose methods ([#4976](https://github.com/mongodb/node-mongodb-native/issues/4976)) ([43ce3eb](https://github.com/mongodb/node-mongodb-native/commit/43ce3ebb701bf24af797d24e81788b576dccf1a9)) * **NODE-7549:** send afterClusterTime on writes in causally-consistent sessions ([#4963](https://github.com/mongodb/node-mongodb-native/issues/4963)) ([3abfd26](https://github.com/mongodb/node-mongodb-native/commit/3abfd263c5da2eaa5c223a0d5b9b440a1e1d4cf6)) ##### Documentation * [Reference](https://docs.mongodb.com/drivers/node/current/) * [API](https://mongodb.github.io/node-mongodb-native/7.4/) * [Changelog](https://github.com/mongodb/node-mongodb-native/blob/v7.4.0/HISTORY.md) We invite you to try the `mongodb` library immediately, and report any issues to the [NODE project](https://jira.mongodb.org/projects/NODE). ### v7.3.0 - Date: 2026-06-09 - Version: v7.3.0 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.3.0 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.3.0 - **changed** — Bump maxWireVersion to 29 in preparation for MongoDB LTS v9.0 - **fixed** — Fix SCRAM authentication for non-Node.js runtimes such as Deno by using explicit UTF-8 string conversion instead of implicit toString() calls on byte arrays > [!IMPORTANT] > A future minor release will raise the minimum supported MongoDB Server version from 4.2 to 4.4. This is in accordance with [MongoDB Software Lifecycle Schedules](https://www.mongodb.com/legal/support-policy/lifecycles). Support for MongoDB Server 4.2 will be dropped in a future release! ##### [7.3.0](https://github.com/mongodb/node-mongodb-native/compare/v7.2.0...v7.3.0) (2026-06-04) The MongoDB Node.js team is pleased to announce version 7.3.0 of the `mongodb` package! ##### Release Notes ###### `maxWireVersion` is bumped to `29` Max wire version & max server version bumped in preparation for MongoDB LTS (v9.0). ###### Fixed SCRAM authentication for non-Node.js runtimes (e.g., Deno) SCRAM-based authentication (the default mechanism for username/password connections) was broken when using the driver in non-Node.js environments such as Deno. The root cause was an implicit `toString()` call on byte arrays that produced incorrect output outside of Node.js. This fix ensures explicit UTF-8 string conversion is used throughout the SCRAM implementation, restoring authentication in Deno and other web-compatible runtimes. ###### Features * **NODE-7518:** bump maxWireVersion ([#4950](https://github.com/mongodb/node-mongodb-native/issues/4950)) ([4447050](https://github.com/mongodb/node-mongodb-native/commit/444705061ae49973a432fbcb0098419b72b75409)) ###### Bug Fixes * **NODE-7548:** SCRAM authentication fails on non-Node runtimes ([#4932](https://github.com/mongodb/node-mongodb-native/issues/4932)) ([a10d2c9](https://github.com/mongodb/node-mongodb-native/commit/a10d2c937eaa2bfb30aece513c9770ec55541280)) ##### Documentation * [Reference](https://docs.mongodb.com/drivers/node/current/) * [API](https://mongodb.github.io/node-mongodb-native/7.3/) * [Changelog](https://github.com/mongodb/node-mongodb-native/blob/v7.3.0/HISTORY.md) We invite you to try the `mongodb` library immediately, and report any issues to the [NODE project](https://jira.mongodb.org/projects/NODE). ### v7.2.0 - Date: 2026-04-20 - Version: v7.2.0 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.2.0 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.2.0 - **added** — Support for MongoDB's Intelligent Workload Management with graceful handling of write-blocking scenarios and optimized connection establishment during high-load conditions - **added** — New client option `maxAdaptiveRetries` (default: 2) to configure the maximum number of retries during server overload - **added** — New client option `enableOverloadRetargeting` (default: false) to deprioritize servers that return overload errors during retry server selection - **added** — Experimental `runtimeAdapters` client option to allow injection of core Node.js APIs for use in alternative runtimes and restricted environments - **added** — Support for injecting Node.js `os` module via `runtimeAdapters` - **added** — Add `bufferedCount()` method to ChangeStream to return the number of documents remaining in the change stream from the last batch - **changed** — Replace Node-specific Buffer APIs with standard Uint8Array APIs - **changed** — Replace Node-specific crypto API with standard Web Crypto API `globalThis.crypto` - **changed** — Implement exponential backoff and jitter in retry loops ##### [7.2.0](https://github.com/mongodb/node-mongodb-native/compare/v7.1.0...v7.2.0) (2026-04-17) The MongoDB Node.js team is pleased to announce version 7.2.0 of the `mongodb` package! ##### Release Notes ###### ⚙️ Added support for MongoDB's Intelligent Workload Management Added support for MongoDB's [Intelligent Workload Management IWM and ingress connection rate limiting features. The driver now gracefully handles write-blocking scenarios and optimizes connection establishment during high-load conditions to maintain application availability. Two new client options are available: - `maxAdaptiveRetries` (default: 2) - configures the maximum number of retries during server overload. Set to 0 to disable overload retries. - `enableOverloadRetargeting` (default: false) - when enabled, the driver will deprioritize servers that return overload errors during retry server selection. These features will be functional with MongoDB Atlas Server Version 9.0 and above. ###### 🧩 Runtime and platform compatibility improvements ###### Node-specific platform APIs replaced with standards-based equivalents The following Node-specific APIs have been replaced with standards-based equivalents: - The driver now uses the standard `Uint8Array` APIs instead of the Node‑specific `Buffer` APIs. - The driver now uses the standard Web Crypto API `globalThis.crypto` instead of the Node‑specific `crypto` API. These changes reduce the number of patches required to run the driver outside of Node.js and improve compatibility with non-Node.js runtimes. ###### Experimental Support for Dependency Injection of Nodejs Runtime Dependencies This release introduces a new MongoClient option, `runtimeAdapters`. `runtimeAdapters` allows injection of core Nodejs APIs, to allow users of the driver to use alternative runtimes that don't support Nodejs compatibility or work in restricted environments. > [!WARNING] > `runtimeAdapters` is experimental and the actual interface of each dependency might change at any time. Notes about usage of `runtimeAdapters`: 1. If no `runtimeAdapter` is provided for a core Nodejs module that the driver uses, the driver will import the corresponding module from Nodejs. 2. Adapters are per-client. 3. Each adapter specifies the required APIs as a part of its Typescript API definition. There are no runtime checks to ensure all required functions are provided; the onus is on users to ensure that all required module dependencies are provided. 4. The `runtimeAdapters` Typescript types currently rely on Nodejs' type definitions (`@types/node`). To use `runtimeAdapters` in a Typescript project, `@types/node` must be installed as well. 5. When providing a module in `runtimeAdapters`, all required functions inside that module must be provided. For example, when injecting the `os` module, the `platform()` function cannot be omitted. ###### `runtimeAdapters` supports injecting Nodejs' `os` module The `os` module is pluggable using `runtimeAdapters`: ```typescript const os: OsAdapter = { // implement the required OSAdapter interface } // `client` will never import or make use of the `os` module and instead only rely on the `os` adapter specified above. const client = new MongoClient(, { runtimeAdapters: { os } }); ``` ###### ☀️ ChangeStreams now have a `bufferedCount()` method that matches cursors In some circumstances it may be desirable to determine if there are local documents stored in your change stream before invoking one of the async methods (`tryNext`, `hasNext` etc.). The `changeStream.bufferedCount()` returns the number of documents remaining inside the change stream from the last batch. Shout out to @typesafe for contributing this feature! ###### Features * **NODE-7315:** Use BSON ByteUtils instead of Nodejs Buffer ([#4840](https://github.com/mongodb/node-mongodb-native/issues/4840)) ([1add538](https://github.com/mongodb/node-mongodb-native/ _[Truncated at 4000 characters — full notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.2.0]_ ### v7.1.1 - Date: 2026-03-24 - Version: v7.1.1 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.1.1 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.1.1 - **fixed** — Tighten OIDC ALLOWED_HOSTS wildcard matching to require full subdomain/path matches for *. and */ entries, preventing partial suffix matches from being incorrectly accepted - **fixed** — Apply TCP keep-alive and no-delay settings on TLS connections by explicitly calling setKeepAlive() and setNoDelay() on the socket after creation ##### [7.1.1](https://github.com/mongodb/node-mongodb-native/compare/v7.1.0...v7.1.1) (2026-03-24) The MongoDB Node.js team is pleased to announce version 7.1.1 of the `mongodb` package! ##### Release Notes ###### Tighten OIDC ALLOWED_HOSTS wildcard matching The OIDC ALLOWED_HOSTS wildcard handling has been fixed to require full subdomain/path matches for *. and */ entries, preventing partial suffix matches from being incorrectly accepted. ###### Fixed TCP keep-alive and no-delay settings not being applied on TLS connections Due to a [Node.js bug](https://github.com/nodejs/node/issues/62003), `tls.connect()` silently ignores `keepAlive`, `keepAliveInitialDelay`, and `noDelay` options passed through its constructor. This could cause idle connections - particularly through cloud load balancers like Azure (240s idle timeout) or AWS PrivateLink/NLB - to be dropped unexpectedly due to missing TCP keep-alive probes. The driver now explicitly calls `setKeepAlive()` and `setNoDelay()` on the socket after creation, ensuring these settings are always applied regardless of whether TLS is used. ###### Bug Fixes * **NODE-7477:** OIDC host allowlist fix ([#4896](https://github.com/mongodb/node-mongodb-native/issues/4896)) ([237c9ab](https://github.com/mongodb/node-mongodb-native/commit/237c9abf26e78d6d059b5f31177b25d4ab7e4e89)) * **NODE-7482:** explicitly call setKeepAlive and setNoDelay on socket ([#4900](https://github.com/mongodb/node-mongodb-native/issues/4900)) ([b14ba21](https://github.com/mongodb/node-mongodb-native/commit/b14ba210783a62d475086bb739a75bc7f5db37f1)) ##### Documentation * [Reference](https://docs.mongodb.com/drivers/node/current/) * [API](https://mongodb.github.io/node-mongodb-native/7.1/) * [Changelog](https://github.com/mongodb/node-mongodb-native/blob/v7.1.1/HISTORY.md) We invite you to try the `mongodb` library immediately, and report any issues to the [NODE project](https://jira.mongodb.org/projects/NODE). ### v7.1.0 - Date: 2026-02-04 - Version: v7.1.0 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.1.0 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.1.0 - **removed** — aws4 package is no longer required for AWS authentication - **changed** — Driver no longer relies on Node.js util.promisify() API for improved compatibility with alternate runtimes - **changed** — Driver now explicitly imports node:process instead of relying on global.process - **changed** — Replace process.arch with os.arch() - **changed** — Replace process.platform with os.platform() - **changed** — Replace os.endianness() with BSON.NumberUtils - **changed** — Replace process.hrtime() with performance.now() - **changed** — Replace process.nextTick() with queueMicrotask() - **fixed** — Connection establishment failures no longer clear the pool, preventing unnecessary connection churn in server overload scenarios - **changed** — withTransaction now applies exponential backoff during transaction retries - **changed** — Server selection deprioritizes servers during retries - **changed** — OIDC authentication now supports hosts matching *.mongo.com in its default ALLOWED_HOSTS list - **fixed** — OIDC reauthentication now works with promoteValues: false - **fixed** — Aggregations with write stages now correctly respect secondary and secondaryPreferred read preferences due to corrected commonWireVersion initialization - **deprecated** — RenameCollectionOptions.new_collection option is deprecated and will be removed in a future major release ##### [7.1.0](https://github.com/mongodb/node-mongodb-native/compare/v7.0.0...v7.1.0) (2026-02-02) The MongoDB Node.js team is pleased to announce version 7.1.0 of the `mongodb` package! ##### Release Notes ###### 🧩 Runtime and platform compatibility improvements ###### `aws4` package no longer required for AWS authentication The [aws4](https://www.npmjs.com/package/aws4) package is no longer required to use AWS authentication, reducing the dependency footprint. ###### Usages of `util.promisify` have been removed The driver no longer relies on Node.js’s `util.promisify()` API, which improves compatibility with alternate runtimes. ###### Explicit `node:process` import instead of `global.process` The driver now explicitly imports `node:process` instead of relying on `global.process`, allowing bundlers and alternate runtimes to supply and optimize the `process` implementation more consistently. ###### Node-specific platform APIs replaced with standards-based equivalents The driver replaces several Node-specific APIs with standards-based equivalents: - `process.arch` → `os.arch()` - `process.platform` → `os.platform()` - `os.endianness()` → `BSON.NumberUtils` - `process.hrtime()` → `performance.now()` - `process.nextTick()` → `queueMicrotask()` These changes reduce the number of patches required to run the driver outside of Node.js and improve compatibility with non-Node.js runtimes. ###### 🔁 Connection resilience and retry behavior improvements ###### Connection churn avoidance in server overload scenarios When [server-side connection rate limiting](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.ingressConnectionEstablishmentRateLimiterEnabled) is enabled and the rate limiter kicks in under periods of high connection establishment,the driver will additionally churn connections by clearing the pool every time the rate limiter rejects an incoming connection request. In this new driver release, connection establishment failures no longer clear the pool, preventing unnecessary connection churn in these scenarios. ###### `withTransaction` now applies exponential backoff during transaction retries The convenient transaction API, `withTransaction`, now uses exponential backoff between retries when a transaction must be retried. Under high server load, this can help prevent transaction retry storms. ###### Server selection deprioritizes servers during retries When retrying a command, the driver now deprioritizes servers during server selection, improving stability and reducing the likelihood of repeatedly targeting overloaded or previously failed servers. ###### 🔐 OIDC authentication improvements ###### Expanded the list of `ALLOWED_HOSTS` for OIDC OIDC authentication now supports hosts matching `*.mongo.com` in its default `ALLOWED_HOSTS` list. ###### OIDC reauthentication now works with `promoteValues: false` When `MongoClient` is configured with `promoteValues: false` (for applications that rely on raw BSON types), OIDC reauthentication now succeeds as expected. ###### ✅ Fixed read preference adherence for `$merge` and `$out` aggregations Resolved an issue where the driver failed to detect MongoDB 5.0+ capabilities due to incorrect `commonWireVersion` initialization. As a result, aggregations with write stages now correctly respect `secondary` and `secondaryPreferred` read preferences, rather than forcing execution on the primary. Huge thanks to @crehbichler for discovering and investigating this bug and for [implementing a fix](https://github.com/mongodb/node-mongodb-native/pull/4805)! ###### ⚠️ Deprecations ###### `RenameCollectionOptions.new_collection` This option has been unused since driver 4.x. It is now deprecated and will be removed in a future major release. Existing code that sets this option can safely remove it with no behavioral change. ###### Features * **NODE-5393:** aws4 no longer required for AWS authentication ([#4824](https://github. _[Truncated at 4000 characters — full notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.1.0]_ ### v7.0.0 - Date: 2025-11-06 - Version: v7.0.0 - Original notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.0.0 - Permalink: https://whatsnew.fyi/product/mongodb-node-driver/releases/v7.0.0 - **changed** — Minimum supported Node.js version is now v20.19.0 - **changed** — TypeScript target has been updated to ES2023 - **added** — Native support for explicit resource management with Symbol.asyncDispose implementations on MongoClient, ClientSession, ChangeStream and cursors - **changed** — Driver updated to use bson@7.0.0 and mongodb-connection-string-url@7.0.0 - **changed** — Minimum version for @mongodb-js/zstd optional peer dependency raised to 7.0.0, dropped support for 1.x and 2.x - **changed** — Minimum version for kerberos optional peer dependency raised to 7.0.0, dropped support for 2.x - **changed** — Minimum version for mongodb-client-encryption optional peer dependency raised to 7.0.0, dropped support for 6.x - **changed** — Updated compatibility for @aws-sdk/credential-providers to ^3.806.0, gcp-metadata to ^7.0.1, and socks to ^2.8.6 - **changed** — @aws-sdk/credential-providers is now required for MONGODB-AWS authentication - **changed** — Custom AWS credential provider via AWS_CREDENTIAL_PROVIDER takes highest precedence over other AWS auth methods - **removed** — Explicitly provided credentials no longer accepted with MONGODB-AWS authentication in connection strings - **changed** — Dropping a collection returns false instead of throwing when namespace not found - **changed** — Aggregate with write concern and explain now throws MongoServerError instead of client-side error - **fixed** — All encryption-related errors now subclass MongoError - **fixed** — Fixed typo in error label from PoolRequstedRetry to PoolRequestedRetry ##### [7.0.0](https://github.com/mongodb/node-mongodb-native/compare/v6.20.0...v7.0.0) (2025-11-06) The MongoDB Node.js team is pleased to announce version 7.0.0 of the `mongodb` package! ##### Release Notes The following is a detailed collection of the changes in the major v7 release of the `mongodb` package for Node.js. The main focus of this release was usability improvements and a streamlined API. Read on for details! > [!IMPORTANT] > This is a list of changes relative to v6.21.0 of the driver. ALL changes listed below are BREAKING unless indicated otherwise. > Users migrating from an older version of the driver are advised to upgrade to at least v6.21.0 before adopting v7. ##### 🛠️ Runtime and dependency updates ###### Minimum Node.js version is now v20.19.0 The minimum supported Node.js version is now [v20.19.0](https://nodejs.org/en/blog/release/v20.19.0) and our TypeScript target has been updated to ES2023. We strive to keep our minimum supported Node.js version in sync with the runtime's [release cadence](https://nodejs.dev/en/about/releases/) to keep up with the latest security updates and modern language features. Notably, the driver now offers native support for explicit resource management. `Symbol.asyncDispose` implementations are available on the `MongoClient`, `ClientSession`, `ChangeStream` and on cursors. > [!Note] > Explicit resource management is considered experimental in the driver and will be until the [TC39 explicit resource management proposal](https://github.com/tc39/proposal-explicit-resource-management) is completed. ###### `bson` and `mongodb-connection-string-url` versions 7.0.0 This driver version has been updated to use `bson@7.0.0` and `mongodb-connection-string-url@7.0.0`, which match the driver's Node.js runtime version support. BSON functionality re-exported from the driver is furthermore subject to the changes outlined in the [BSON V7 release notes](https://github.com/mongodb/js-bson/releases/tag/v7.0.0). ###### Optional peer dependency releases and version bumps - `@mongodb-js/zstd` optional peer dependency minimum version raised to `7.0.0`, dropped support for `1.x` and `2.x` (note that `@mongodb-js/zstd` does not have `3.x-6.x` version releases) - `kerberos` optional peer dependency minimum version raised to `7.0.0`, dropped support for `2.x` (note that `kerberos` does not have `3.x-6.x` version releases) - `mongodb-client-encryption` optional peer dependency minimum version raised to `7.0.0`, dropped support for `6.x` Additionally, the driver is now compatible with the following packages: | Dependency | Previous Range | New Allowed Range | | ----------------------------- | -------------- | ----------------- | | @aws-sdk/credential-providers | ^3.188.0 | ^3.806.0 | | gcp-metadata | ^5.2.0 | ^7.0.1 | | socks | ^2.7.1 | ^2.8.6 | ##### 🔐 AWS authentication To improve long-term maintainability and ensure compatibility with AWS updates, we’ve standardized AWS auth to use the official SDK in all cases and made a number of supporting changes outlined below. ###### `@aws-sdk/credential-providers` is now required for MONGODB-AWS authentication Previous versions of the driver contained two implementations for AWS authentication and could run the risk of the custom driver implementation not supporting all AWS authentication features as well as not being correct when AWS makes changes. Using the official AWS SDK in all cases alleviates these issues. ```bash npm install @aws-sdk/credential-providers ``` ###### Custom AWS credential provider takes highest precedence When providing a custom AWS credential provider via the auth mechanism property `AWS_CREDENTIAL_PROVIDER`, it will now take the highest precedence over any other AWS auth method. ###### Explicitly provided credentials no longer accepted with MONGODB-AWS authentication AWS environments (such as AWS Lambd _[Truncated at 4000 characters — full notes: https://github.com/mongodb/node-mongodb-native/releases/tag/v7.0.0]_