> This page location: /docs.md > /docs/drivers.md > /docs/languages/javascript.md > /docs/drivers/node/current.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Release Notes

Learn what's new in:

- [Version 7.8](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.8)

- [Version 7.7](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.7)

- [Version 7.6](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.6)

- [Version 7.5](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.5)

- [Version 7.4](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.4)

- [Version 7.3](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.3)

- [Version 7.2](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.2)

- [Version 7.1](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.1)

- [Version 7.0](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-7.0)

- [Version 6.21](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.21)

- [Version 6.20](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.20)

- [Version 6.19](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.19)

- [Version 6.18](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.18)

- [Version 6.17](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.17)

- [Version 6.16](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.16)

- [Version 6.15](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.15)

- [Version 6.14](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.14)

- [Version 6.13](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.13)

- [Version 6.12](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.12)

- [Version 6.11](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.11)

- [Version 6.10](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.10)

- [Version 6.9](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.9)

- [Version 6.8](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.8)

- [Version 6.7](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.7)

- [Version 6.6](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.6)

- [Version 6.5](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.5)

- [Version 6.4](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.4)

- [Version 6.3](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.3)

- [Version 6.2](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.2)

- [Version 6.1](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.1)

- [Version 6.0](https://www.mongodb.com/docs/drivers/node/current/reference/release-notes.md#std-label-version-6.0)

## What's New in 7.8

**Warning: Upgrade to v7.8**

Driver version 7.8 fixes the following vulnerabilities found in previous driver versions:

- In driver versions 6.11 through 6.21 and 7.0 through 7.7, the `timeoutMS` connection option can cause connection pool desynchronization. The desynchronization occurs after an operation timeout and can expose other users' data.

- In driver versions 3.3.3 through 7.7, an attacker in control of a DNS response could exploit an SRV host name verification issue and redirect the driver to a host outside your domain.

The Node.js driver v7.8 release includes the following changes:

- Deprecates the `timeoutMS` and `timeoutMode` connection options. These options have no effect and are slated for removal in a future release. Use the per-stage timeout options `serverSelectionTimeoutMS`, `waitQueueTimeoutMS`, `socketTimeoutMS`, and `maxTimeMS` instead.

- Adds the following options for validating host names returned by SRV lookups:

  - `srvAllowedHostsSuffix`: Specifies a host name suffix that every host returned by the SRV lookup must end with. You can configure this option on the client or in the connection string.

  - `srvHostValidator`: Specifies a synchronous function that accepts a host name and returns a Boolean value indicating whether the driver may use it. You can configure this option on the client only.

  Modifying the default SRV domain name validation can create vulnerabilities.

- Compares SRV host names case-insensitively, without a trailing dot, and with internationalized names in `xn--` form.

- Uses the Node.js built-in `zstd` implementation for network compression on Node.js 22.15.0 and later. On older versions, the driver continues to use `@mongodb-js/zstd`. No changes are needed for existing setups.

- Adds a `createIndex()` overload that accepts a third parameter containing options for the `createIndexes` command. This form separates command-level options such as `commitQuorum` and `maxTimeMS` from options that describe the index itself. When you use the three-parameter form, the driver passes index options to the server as written. With this form, you can use new index options without waiting for the driver to support them. The two-parameter form is deprecated and is slated for removal in a future major release. Until then, it continues to filter out invalid index options.

- Removes the `@experimental` designation from the `encryptedFields` options on `createCollection()` and `dropCollection()`, the `keyMaterial` option, and the `ClientEncryptionRewrapManyDataKeyProviderOptions` and `ClientEncryptionRewrapManyDataKeyResult` types. The `rewrapManyDataKey()` method now returns the `ClientEncryptionRewrapManyDataKeyResult` type.

- Fixes an issue in which sorting by `$meta` in a `[field, direction]` pair, such as `cursor.sort(['score', { $meta: 'textScore' }])`, failed with a `MongoInvalidArgumentError`.

- Fixes an issue in which `BulkWriteResult.insertedIds` for unordered bulk writes that mixed inserts with updates or deletes used a running count of inserts as the key. The property is now keyed by each insert's index in the operations list, matching ordered bulk writes.

- Matches file IDs with `$eq` in GridFS download, delete, rename, and upload-abort queries. The behavior is unchanged for typical file IDs, such as `ObjectId` or string values, but commands appear as `{ _id: { $eq: <id> } }` in command monitoring and logs.

- Stops compressing `hello` and `isMaster` commands on monitoring connections.

To learn more about this release, see the [v7.8.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.8.0) on GitHub.

## What's New in 7.7

The Node.js driver v7.7 release includes the following changes:

- Updates the following driver dependencies:

  - `bson` to v7.3.2

  - `mongodb-connection-string-url` to v7.0.2

  - `@mongodb-js/saslprep` to v1.5.0

- Fixes an issue in which a single failed OIDC token fetch caused all later operations on the same `MongoClient` to fail with the original error until the application restarted. A failed token fetch now affects only the operation that triggered it.

To learn more about this release, see the [v7.7.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.7.0) on GitHub.

## What's New in 7.6

The Node.js driver v7.6 release includes the following changes:

- Adds HTTP proxy support for In-Use Encryption key management service (KMS) requests. You can set the `kmsConnectCallback` option on your `ClientEncryptionOptions` object or your `AutoEncryptionOptions` object to control how the driver connects to a KMS host, such as by tunneling through an HTTP proxy. To learn more, see [Route KMS Requests Through an HTTP Proxy.](https://www.mongodb.com/docs/drivers/node/current/security/encrypt-fields.md#std-label-node-csfle-kms-http-proxy)

- Removes support for MongoDB Server v4.2.

- Improves the performance of Intelligent Workload Management (IWM) by introducing a policy that retries overload errors only when doing so is not expected to degrade server conditions.

- Adds the `baseBackoffMS` client option, which configures the base backoff duration the driver uses for retry attempts, and updates the client's backpressure backoff behavior to use it.

- Fixes a `ReferenceError: require is not defined` error that occurred when bundling the driver into an ECMAScript module (ESM) build.

- Improves the performance of `insertMany()` and `bulkWrite()` operations by serializing each document only once instead of twice. The improvement is most noticeable with high document counts and documents that have many fields.

To learn more about this release, see the [v7.6.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.6.0) on GitHub.

## What's New in 7.5

The Node.js driver v7.5 release includes the following changes:

- Promotes Queryable Encryption string queries to general availability, replacing `TextOpts` with `StringOpts`, and the `TextPreview` algorithm with `String`. The `prefix`, `suffix`, and `substring` query types are now generally available for exact and range-style string matching against encrypted fields when connected to MongoDB Server 9.0. The legacy preview query types (`prefixPreview`, `suffixPreview`, `substringPreview`) are deprecated.

- Fixes an issue in which `MongoClient.close()` did not properly interrupt in-flight operations on replica sets and sharded clusters. Checked-out connections previously remained open until their operations completed. `MongoClient.close()` now closes all checked-out connections across all servers.

To learn more about this release, see the [v7.5.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.5.0) on GitHub.

## What's New in 7.4

The Node.js driver v7.4 release includes the following changes:

- Stabilizes the `Symbol.asyncDispose` method on `MongoClient`, `ClientSession`, `ChangeStream`, and cursors. This enables the `await using` syntax for automatic resource cleanup. These methods were introduced as experimental features in v6.9.0.

- Adds `readConcern.afterClusterTime` to write operations in causally-consistent sessions, matching existing read operation behavior. This keeps "read your own writes" guarantees when a primary fails in a sharded cluster.

To learn more about this release, see the [v7.4.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.4.0) on GitHub.

## What's New in 7.3

The Node.js driver v7.3 release includes the following changes:

- Bumps the maximum wire protocol version to `29` in preparation for MongoDB Server v9.0.

- Fixes an issue in which SCRAM authentication failed when running the driver in non-Node.js runtimes such as Deno. The Node.js driver now uses explicit UTF-8 string conversion throughout the SCRAM implementation to restore authentication in Deno and other web-compatible runtimes.

- Deprecates support for MongoDB Server 4.2. A future minor release will raise the minimum supported MongoDB Server version to 4.4.

- Fixes a bug where BSON did not reset internal state when building Node.js startup snapshots, which could cause processes to share the same unique ID state.

To learn more about this release, see the [v7.3.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.3.0) on GitHub.

## What's New in 7.2

The Node.js driver v7.2 release includes the following features:

- Introduces the experimental `runtimeAdapters` client option, which enables the injection of custom implementations for the `node:os` module. This allows you to run the driver in JavaScript environments that don’t fully support Node’s built‑in modules. To learn more, see the [Specify Connection Options](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options.md#std-label-node-connection-options) guide.

- Adds a `bufferedCount()` method to `ChangeStream`, consistent with the existing method on cursors.

- Adds support for ingress connection rate limiting features. You can use the `maxAdaptiveRetries` and `enableOverloadRetargeting` client options to configure this behavior. To learn more about these options, see the [Specify Connection Options](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options.md#std-label-node-connection-options) guide.

- Replaces the following Node-specific APIs with standards-based equivalents:

  - `Buffer` APIs: Use the standard `Uint8Array` APIs instead.

  - `crypto` APIs: Use the standard `globalThis.crypto` API instead.

- Fixes the `Binary` constructor to normalize the `subType` parameter to a number at construction time, matching the serializer behavior. For example, passing a stringified subtype, such as `'4'`, no longer causes a mismatch between the in-memory `sub_type` property and the serialized BSON value.

To learn more about this release, see the [v7.2.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.2.0) on GitHub.

## What's New in 7.1

The Node.js driver v7.1 release includes the following features:

- Adds logic for `MONGODB-AWS` authentication to the driver, so the `aws4` package is no longer required to use `MONGODB-AWS` authentication. To learn more about `MONGODB-AWS` authentication, see the [AWS IAM Authentication Mechanism](https://www.mongodb.com/docs/drivers/node/current/security/authentication/aws-iam.md#std-label-node-authentication-aws) guide.

- Improves runtime compatibility by eliminating all uses of `util.promisify`.

- Uses explicit `node:process` import instead of `global.process` so bundlers and alternate runtimes can supply and optimize the process implementation more consistently.

- Replaces several Node-specific APIs with standards-based equivalents to reduce the number of patches required to run the driver outside of Node.js:

  - `process.arch` is now `os.arch()`

  - `process.platform` is now `os.platform()`

  - `os.endianness()` is now `BSON.NumberUtils`

  - `process.hrtime()` is now `performance.now()`

  - `process.nextTick()` is now `queueMicrotask()`

- Improves retry behavior:

  - Prevents unnecessary connection pool churn when server-side connection rate limiting is enabled by no longer clearing the pool when connections fail.

  - Adds exponential backoff to `withTransaction()` retry behavior.

  - Deprioritizes overloaded or failed servers during server selection retries.

- OIDC authentication improvements:

  - Expands the default `OIDC ALLOWED_HOSTS` list to include `*.mongo.com`.

  - Fixes OIDC reauthentication when `promoteValues: false` is enabled.

- Corrects read preference handling for aggregations using `$merge` and `$out`.

- Deprecates `RenameCollectionOptions.new_collection` for future removal

To learn more about this release, see the [v7.1.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.1.0) on GitHub.

## What's New in 7.0

**Warning: Breaking Changes in v7.0**

This driver version introduces breaking changes. For a list of these changes, see the [Version 7.0 Breaking Changes section](https://www.mongodb.com/docs/drivers/node/current/reference/upgrade.md#std-label-node-breaking-changes-v7.0) in the Upgrade guide.

The Node.js driver v7.0 release includes the following features:

- Updates the minimum Node.js version to v20.19.0.

- Updates the `bson` and `mongodb-connection-string-url` versions to `7.0.0`. To learn more about updated BSON functionality for v7.0.0, see the changes outlined in the [BSON v7 release notes.](https://github.com/mongodb/js-bson/releases/tag/v7.0.0)

- Updates the peer dependency matrix for the following packages to the following allowed ranges:

  - `@aws-sdk/credential-providers`:  ^3.806.0

  - `@mongodb-js/zstd`:       ^2.0.0

  - `gcp-metadata`:   ^7.0.1

  - `socks`:  ^2.8.6

  For the full dependency compatibility table, see the Node.js [Component Compatibility](https://www.mongodb.com/docs/drivers/compatibility/?driver-language=javascript\&javascript-driver-framework=nodejs#component-compatibility) table on the Driver Compatibility Tables page.

- Improves `MongoClient.connect()` consistency across environments by allowing the `connect()` function to run a handshake regardless of whether credentials are defined.

- Updates `MongoClient.close()` to attempt to clean up sessions only if the topology supports sessions.

- Marks the options parameter for the `ClientEncryption.rewrapManyDataKey()` method as optional to resolve a TypeScript mismatch.

- Wraps `socket.write` calls in a try/catch block to ensure that errors properly result in a retry.

- Adds breaking changes for AWS authentication. To learn more about these breaking changes, see the [Version 7.0 Breaking Changes section](https://www.mongodb.com/docs/drivers/node/current/reference/upgrade.md#std-label-node-breaking-changes-v7.0) in the Upgrade guide.

- Adds the following error handling improvements:

  - When you drop a collection, the collection returns `false` rather than throwing `namespace not found` errors.

  - Aggregation with a `writeConcern` and `explain` throws a `MongoServerError` rather than a client-side error.

  - All errors thrown during encryption are subclasses of `MongoError`.

To learn more about this release, see the [v7.0.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v7.0.0) on GitHub.

## What's New in 6.21

The Node.js driver v6.21 release includes the following features:

- Deprecates the following properties and interface, which will be removed in v7.0:

  - `MongoCredentials.authMechanismProperties.AWS_SESSION_TOKEN`

  - `CommandOptions.noResponse`

  - `ConnectionOptions.cancellationToken`

  - `CursorStreamOptions`

To learn more about this release, see the [v6.21.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.21.0) on GitHub.

## What's New in 6.20

The Node.js driver v6.20 release includes the following features:

- No longer generates an error when the `hint` option is provided to unacknowledged `update` commands. When connected to MongoDB Server 4.4 or later, the driver also supports the `hint` option for unacknowledged `delete` and `findAndModify` commands.

- Allows you to access the parent `Db` object from a `Collection` and the parent `MongoClient` object from a `Db`.

- Deprecates the `ServerCapabilities` class.

- Deprecates the `ReadPreference.minWireVersion` property.

- Deprecates the following `MongoClient` options:

  - `driverInfo`

  - `additionalDriverInfo`

  - `metadata`

  - `extendedMetadata`

- Deprecates the `CommandOperationOptions.retryWrites` option. The Node.js driver supports the `retryWrites` option only at the `MongoClient` level and already ignored the option when it was set at the operation level. However, this option will be removed in a future major release and might generate type or build errors in your code.

- Updates the `resumeToken` when you use the `tryNext()` method to iterate change stream events. Previous driver versions did not update the `resumeToken`, resulting in inconsistent behavior during change stream iteration.

- Allows change streams to resume after the driver encounters a `MongoServerSelectionError`.

- Ignores duplicate metadata when calling `MongoClient.appendMetadata()`.

To learn more about this release, see the [v6.20.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.20.0) on GitHub.

## What's New in 6.19

The Node.js driver v6.19 release includes the following features:

- Adds experimental support for Queryable Encryption text field prefix, suffix, and substring queries. You must upgrade your `mongodb-client-encryption` package to v6.5.0 or later to use this feature.

  **Important:**

  Substring, prefix and suffix search are in preview and are intended for experimental workloads only.

- Deprecates the following options for `findOne()` operations:

  - `limit`

  - `noCursorResponse`

  - `batchSize`

- Ensures that `findOne()` can only receive a single batch of documents from the server to avoid unnecessary `killCursor` commands.

- Adds support to specify a `secureContext` to `tlsOptions:<provider>` in the `autoEncryption` options on the `MongoClient` or as an option to the\`\`ClientEncryption\`\` object. This allows you to pass `tlsCAFile` and `tlsCertificateKeyFile` as in memory options to both `MongoClientOptions.autoEncryption.tlsOptions` and `ClientEncryption`.

- When authentication is enabled, the `MongoClient` now checks a connection out of the connection pool to force the initial handshake and checks it back in when connecting. This prevents unnecessary `ping` commands when connecting.

To learn more about this release, see the [v6.19.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.19.0) on GitHub.

## What's New in 6.18

The Node.js driver v6.18 release includes the following features:

- Deprecates the following members and types:

  - `Transaction.options()`

  - `Transaction.recoveryToken()`

  - `Transaction.isPinned()`

  - `Transaction.isStarting()`

  - `Transaction.isActive()`

  - `Transaction.isCommitted()`

  - `ClientMetadata`

  - `ClientMetadataOptions`

  - `CancellationToken`

  - `CommandOperationOptions.noResponse`

  These members and types will be removed in an upcoming major version of the driver.

- Adds an `appendMetadata()` method that you can use to add handshake metadata after constructing the `MongoClient` object. The following example shows how to use this method to add the library name, version, and platform to a `MongoClient` object:

  ```javascript
  import { MongoClient } from 'mongodb';

  const client = new MongoClient(process.env.MONGODB_URI);
  client.appendMetadata({ name: 'my library', version: '1.0', platform: 'NodeJS' });
  ```

- Adds a `wallTime` property to all `ChangeStream` event interfaces except `ChangeStreamRefineCollectionShardKeyEvent` and `ChangeStreamReshardCollectionDocument`. This property contains the server date and time of the database operation.

- Adds a `databaseName` property to the `CommandSucceededEvent` and `CommandFailedEvent` events. This property contains the name of the database against which the application executed the command.

- Closes idle connections during periods of no activity, even when the `minPoolSize` setting is set to `0`. This fixes a bug where the `ConnectionPool` did not clean up idle or perished connections unless `minPoolSize` was greater than `0`.

- The driver allocates sessions lazily when a cursor is iterated. In previous versions, the driver allocated sessions whenever a cursor was created, regardless of whether the application iterated on the cursor.

To learn more about this release, see the [v6.18.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.18.0) on GitHub.

## What's New in 6.17

The Node.js driver v6.17 release includes the following features:

- Removes support for MongoDB Server 4.0.

- Upgrades the `bson` package to v6.10.4. For more information about this release, see the [v6.10.4 Release Notes](https://github.com/mongodb/js-bson/releases/tag/v6.10.4) for the `bson` package on GitHub.

- Adds the `keepAliveInitialDelay` option when constructing a `MongoClient`. This option defaults to `120000` milliseconds.

- Retries OIDC authentication when the initial authentication fails due to an expired token error.

- Adds the `sort` option for `updateOne()` and `replaceOne()` operations. This option requires MongoDB Server 8.0 or later.

- Instructs the `MongoClient.close()` method to close outstanding in-use connections.

- Adds a `keyTimeoutMS` encryption option for configuring DEK cache expiration time. This option defaults to `6000` milliseconds and requires `mongodb-client-encryption` version 6.4 or later.

- Instructs update operations to generate an error if the `ignoreUndefined` is set to `true` and all updates are undefined.

- Treats socket errors as network errors.

To learn more about this release, see the [v6.17.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.17.0) on GitHub.

## What's New in 6.16

The Node.js driver v6.16 release includes the following features:

- The `Collection.distinct()` method now supports an optional `hint` parameter which you can use to specify the index to use for the command. This functionality requires MongoDB Server 7.1 or later.

- Fixes a bug with processing of multiple messages within one network data chunk which could cause processing times to slow down.

- Fixes a bug where `FindCursor.rewind()` threw errors in certain cases.

- Deprecates support for MongoDB Server 4.0. Support will be completely removed in a future minor release.

To learn more about this release, see the [v6.16.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.16.0) on GitHub.

## What's New in 6.15

The Node.js driver v6.15 release includes the following features:

- Adds support for supplying custom AWS credentials when configuring [authentication](https://www.mongodb.com/docs/drivers/node/current/security/authentication.md#std-label-node-authentication-mechanisms) or [In-Use Encryption](https://www.mongodb.com/docs/drivers/node/current/security/encrypt-fields.md#std-label-node-fle). You must supply the custom function signature in the following form:

  ```javascript
  () => Promise<AWS.Credentials>
  ```

  You can also specify provider chains from the AWS SDK, allowing you to customize your options. To view examples of how to provide custom credentials, see the [v6.15.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.15.0) on GitHub.

- Fixes a bug that caused a `MongoClient` configured for `OIDC` with an `AbortSignal` to abort on the cursor when the client reauthenticates.

- Fixes a bug that caused an unhandled rejection to throw when a `timeoutms` expires before an operation reaches the server selection process.

- Fixes a bug caused by closing a change stream while processing a change event. This bug caused a potential error to reject an internal promise representing the "next" change.

To learn more about this release, see the [v6.15.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.15.0) on GitHub.

## What's New in 6.14

The Node.js driver v6.14 release includes the following features:

- Adds support for the `$lookup` aggregation stage on encrypted collections. You must upgrade your `mongodb-client-encryption` package to v6.3.0 or later to use this feature. To learn more about this feature, see the [In-Use Encryption](https://www.mongodb.com/docs/drivers/node/current/security/encrypt-fields.md#std-label-node-fle) guide.

- Uses the driver's implementation of the `isUint8Array()` method to prevent importing the `util/types` package.

- Reverts the version compatibility of `@aws-sdk/credential-providers` to v3.188.0.

To learn more about this release, see the [v6.14.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.14.0) on GitHub.

## What's New in 6.13

The Node.js driver v6.13 release includes the following features:

- Adds a new standardized logger to enable insight into database operations without code changes. You can enable and configure the logger through environment variables, as shown in the following example:

  ```bash
  env MONGODB_LOG_ALL=debug node server.mjs
  ```

  To learn more about logging, see the [Logging](https://www.mongodb.com/docs/drivers/node/current/monitoring-and-logging/logging.md#std-label-node-logging) guide.

- Improves command monitoring performance by removing deep copies of command and reply objects. Modifying the command and response values might lead to undefined behavior.

- Adds an experimental abort signal feature. You can pass the `signal` command to the following methods to interrupt the execution of the method when the signal is triggered:

  - `collection.find()`

  - `collection.findOne()`

  - `collection.aggregate()`

  - `collection.countDocuments()`

  - `db.listCollections()`

  - `db.command()`

  Aborting a signal closes a connection, which might cause unnecessary connection reestablishment.

- To avoid potential DNS timeout errors, the driver catches and retries DNS lookups when resolving `mongodb+srv://` connection strings.

- `MongoClient.close()` also closes any associated cursors.

- You can safely invoke `MongoClient.close()` concurrently, but we do not recommend doing so if avoidable.

- Fixes an issue that caused `MONGODB-OIDC` authentication to not properly reauthenticate if the handshake includes speculative authentication.

To learn more about this release, see the [v6.13.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.13.0) on GitHub.

## What's New in 6.12

The Node.js driver v6.12 release includes the following features:

- Adds support for v2.0 of the `zstd` compression algorithm. For more information about `zstd` v2.0, see the `zstd` [Release Notes](https://github.com/mongodb-js/zstd/releases/tag/v2.0.0) on GitHub.

- Upgrades the `bson` package to v6.10.1. For more information about this release, see the [v6.10.1 Release Notes](https://github.com/mongodb/js-bson/releases/tag/v6.10.1) for the `bson` package on GitHub.

- The driver populates the `ServerDescription.error` field with a more specific error type and message when marking a primary replica-set member stale.

- The driver reads socket data with a stream in object mode instead of buffer mode. This prevents message parsing errors in rare cases caused by inaccurate data chunking.

- If the driver encounters an error while connecting to a socks5 proxy, it no longer wraps the socks5 error in a `MongoNetworkError`. This prevents the driver from wrapping a `MongoNetworkError` in another `MongoNetworkError`.

To learn more about this release, see the [v6.12.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.12.0) on GitHub.

## What's New in 6.11

The Node.js driver v6.11 release includes the following features:

- Adds support for Node.js v22.

- Adds the Client-Side Operations Timeout (CSOT) feature. You can use CSOT to apply a single timeout to all steps needed to complete a server-side operation, including server selection, connection checkout, serialization, and server-side execution. To learn more, see the [Limit Server Execution Time](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options/csot.md#std-label-node-csot) guide.

  **Note: Experimental Feature**

  The CSOT feature is experimental and might change in future driver releases.

- Adds OIDC authentication support for Kubernetes environments. To learn more about this feature, see the [OIDC Authentication Mechanism](https://www.mongodb.com/docs/drivers/node/current/security/authentication/oidc.md#std-label-node-authentication-oidc) guide.

  To use OIDC to authenticate from a Kubernetes environment, set the `authMechanismProperties` connection option to `ENVIRONMENT:k8s` in your connection string. You can use this feature when connecting to an environment running in Amazon's Elastic Kubernetes Service, Google Kubernetes Engine, or Azure Kubernetes Service.

- The `bson` package adds support for binary vector data. To learn more about this feature, see the [v6.10.0 Release Notes](https://github.com/mongodb/js-bson/releases/tag/v6.10.0) for the `bson` package on GitHub.

- The driver emits `ConnectionClosedEvents` after `PoolClearedEvents`.

To learn more about this release, see the [v6.11.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.11.0) on GitHub.

## What's New in 6.10

The Node.js driver v6.10 release is the first official release to support all MongoDB Server 8.0 features, and includes the following improvements and fixes:

- Removes support for MongoDB Server 3.6.

- Adds support for the MongoDB Server 8.0 bulk write API, which supports bulk write operations across multiple databases and collections in a single call.

- Allows SRV hostnames with fewer than three parts separated by `.` characters. For example, the driver now supports hostnames such as `mongodb+srv://mongodb.local`.

- Supports the explain option to retrieve an accurate `maxTimeMS` value for CRUD commands to describe the operation time. The explain options for find and aggregate operations are deprecated.

To learn more about this release, see the [v6.10.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.10.0) on GitHub.

## What's New in 6.9

- Support for MongoDB Server 3.6 is deprecated and will be removed in a future driver release.

- The driver natively supports explicit resource management for cursors and the `MongoClient`, `ClientSession`, and `ChangeStream` objects. When using a compatible Node.js version, you can implement explicit resource management by using the `cursor.stream()` method and `GridFSDownloadStream` class.

  To learn how to use explicit resource management, see the [v6.9.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.9.0) on GitHub. For more information about explicit resource management, see the [ECMAScript Explicit Resource Management Proposal](https://tc39.es/proposal-explicit-resource-management/) on the TC39 website.

- If you're using Node.js 18.13 or later, you can pass the `autoSelectFamily` and `autoSelectFamilyTimeout` options to the `MongoClient` constructor. When the `autoSelectFamily` option is `true`, the driver automatically selects between an IPv4 or IPv6 connection. The `autoSelectFamilyTimeout` option specifies the timeout, in milliseconds, for the driver to select the connection family.

  The following code example shows how to use these options:

  ```javascript
  const client = new MongoClient(uri,
    { autoSelectFamily: true, autoSelectFamilyTimeout: 100 });
  ```

- The `MongoClient` constructor accepts the `allowPartialTrustChain` option. This option controls the `X509_V_FLAG_PARTIAL_CHAIN` OpenSSL flag.

- The `ConnectionCheckedOutEvent` and `ConnectionCheckFailedEvent` now include a `durationMS` property. This property indicates the time elapsed between the start and end of a connection checkout operation.

- If you're using Node.js 18 or later, the driver ignores the `cryptoCallbacks` option and uses callbacks defined in C++ instead, significantly improving encryption performance. This change is available in the v6.1.0 version of the `mongodb-client-encryption` package.

- To enhance security, the options specifying the spawn path and arguments for `mongocryptd` must be own properties of `autoEncryption.extraOptions`. This change helps prevent global prototype pollution bugs related to these options. For more information about own properties, see [Object.hasOwn()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn) on MDN.

- Adds official support for Queryable Encryption (QE) range queries. To use this feature, your app must use `mongodb-client-encryption` v6.1.0 or later and must connect to MongoDB Server 8.0 or later. For more information about QE range queries, see [Queryable Encryption](https://www.mongodb.com/docs/manual/core/queryable-encryption/) in the MongoDB Server manual.

- The `insertMany()` and `bulkWrite()` methods accept `ReadonlyArray` inputs.

- The driver retries writes based on the top-level code, found in `error.code`, rather than the nested code in `error.result.writeConcernError.code`. This fixes an issue in sharded clusters running versions MongoDB Server earlier than 4.4.

- The `LocalKMSProviderConfiguration.key` property accepts a `BSON` `Binary` instance for `AutoEncryptionOptions`.

- In TypeScript, the `BulkOperationBase` class reports the `length` getter property.

- The `MongoWriteConcernError` type now preserves the original top-level code in `MongoWriteConcernError.code`.

- The `cursor.toArray()` method empties the current batch of documents into the array before calling the async iterator again. This change avoids the delays associated with `async`/`await` execution and improves performance by up to 5% on average. This optimization doesn't apply if you provide a transform to the `cursor.map()` method before calling the `toArray()` method.

- Fixes mixed use of the `cursor.next()` method with `for await` syntax.

- Adds the `enableUtf8Validation` option when deserializing BSON, which was inadvertently removed in Node.js driver v6.8.

- Adds the `durationMS` property to the `ConnectionReadyEvent` class. This property represents the time between the connection creation event and when the `ConnectionReadyEvent` fires.

To learn more about this release, see the [v6.9.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.9.0) on GitHub.

## What's New in 6.8

The Node.js driver v6.8 release includes the following features:

- Fixes a bug where a local KMS provider accepted a `BSON Binary` instance at runtime, but the TypeScript compiler allowed only values of type `Buffer` and `string`.

- The `ReadConcernMajorityNotAvailableYet` error is now a retryable read error.

- You can now associate a name with, and provide multiple keys for, KMS providers. This feature requires `mongodb-client-encryption` v6.0.1 or later. You can't use named KMS providers if your application uses the automatic KMS provider refresh capability.

  The following code example shows how to configure a `ClientEncryption` object with multiple AWS keys:

  ```javascript
  const clientEncryption = new ClientEncryption(keyVaultClient, {
    'aws:key1': {
      accessKeyId: ...,
      secretAccessKey: ...
    },
    'aws:key2': {
      accessKeyId: ...,
      secretAccessKey: ...
   },

  clientEncryption.createDataKey('aws:key-1', { ... });
  ```

- When you create a KMIP data key, you can now specify the `delegated` option. If this option is set to `true`, the KMIP provider performs encryption and decryption of the data key locally, ensuring that the encryption key never leaves the KMIP server. This feature requires `mongodb-client-encryption` v6.0.1 or later.

  The following code example shows how to specify this option:

  ```javascript
  clientEncryption.createDataKey('kmip', { masterKey: { delegated: true } } );
  ```

- The driver now decodes BSON responses as the cursor iterates over them, rather than decoding the entire BSON response when it is received.

- The Github release for the `mongodb` package now contains a detached signature file, `mongodb-X.Y.Z.tgz.sig`, for the NPM package. This change applies to every major and patch release for versions 5.x and 6.x of the driver. To verify the package signature, follow the instructions in the Release Integrity section of the [README.md](https://github.com/mongodb/node-mongodb-native/blob/v6.8.0/README.md#release-integrity) file in the driver's GitHub repository.

To learn more about this release, see the [v6.8.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.8.0) on GitHub.

## What's New in 6.7

The Node.js driver v6.7 release includes the following features:

- Adds support for the `MONGODB-OIDC` authentication mechanism when connected to MongoDB Server v7.0 and later. The driver supports authentication with Azure machine authentication, GCP machine authentication, callback authentication, and human interaction callback authentication facets.

- Fixes an issue where setting the `useBigInt64` flag to `true` caused the internal `compareTopologyVersion` function to generate an error.

To learn more about this release, see the [v6.7.0 Release Notes](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.7.0) on GitHub.

## What's New in 6.6

The Node.js driver v6.6 release includes the following features:

- Upgrades to using BSON 6.7.0. For details about the new BSON features, see the release notes for [BSON 6.5.0](https://github.com/mongodb/js-bson/releases/tag/v6.5.0), [BSON 6.6.0](https://github.com/mongodb/js-bson/releases/tag/v6.6.0), and [BSON 6.7.0.](https://github.com/mongodb/js-bson/releases/tag/v6.7.0)

- Adds the `addStage()` method to the fluid aggregation API. You can use this method to add aggregation pipeline stages individually, as shown in the following example:

  ```javascript
  const documents = await users.aggregate().addStage({ $project: { name: true } }).toArray();
  ```

- Adds the `cause` and `dependencyName` fields to the `MongoMissingDependencyError` class. You can use these fields to programmatically determine if a package is missing or why a package didn't load.

- Adds the `minRoundTripTime` property to the `ServerDescription` class. This property contains the minimum round-trip time over the last 10 heartbeats.

- Adds the `toJSON()` method to the `TopologyDescription` class. Although you can use this method to stringify `TopologyDescription` objects to JSON, we recommend using Node's `util.inspect()` method instead, because it properly handles all types used in JavaScript and the driver.

- Adds cursor options support for the `Collection.indexExists()`, `Collection.indexes()`, and `Collection.indexInformation()` methods in Typescript.

- Removes support for the `readConcern` and `writeConcern` options from the `Collection.listSearchIndexes()` method. `listSearchIndexes()` is an Atlas-specific method, and Atlas search indexes don't support these options.

- Redefines the `ServerDescription.roundTripTime` property as a moving average. Previously, it was a weighted average of the most recently observed heartbeat duration and the previous duration.

- You can specify the type of a search index when creating the index, as shown in the following example:

  ```js
  const indexName = await collection.createSearchIndex({
      name: 'my-vector-search-index',
      type: 'vectorSearch',
      definition: {
          mappings: { dynamic: false }
      }
  });
  ```

- The `UpdateFilter.$currentDate` property no longer throws an error when you pass it to a compound method, such as `findOneAndUpdate()`, on a collection with a limited schema.

- The driver throws a `MongoTransactionError` only if you provide a `ReadPreferenceMode` other than `primary` and then try to perform a command that involves a read operation.

- The data type of the `TopologyDescription.error` property is `MongoError`.

- The `Collection.indexExists()` method no longer supports the `full` option.

- The `Collection.indexInformation()`, `Collection.indexes()`, and `Db.indexInformation()` methods have a return type of `IndexDescriptionCompact | IndexDescriptionInfo[]` in TypeScript.

- When retrieving AWS KMS (Key Management System) credentials, the driver no longer throws an error when it receives an access key that includes an expiration timestamp.

- The `ClusterTime` interface no longer defines the `signature` field as required in TypeScript.

To learn more about this release, see the [v6.6.0 Release Highlights](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.6.0) on GitHub.

## What's New in 6.5

The Node.js driver v6.5 release includes the following features:

- Updates bulk write operations to use the `pkFactory` class for document ID generation.

**Warning:**

If you previously specified an instance of a `pkFactory` to handle bulk writes, the `_id` fields of the documents inserted by using bulk writes may be inconsistent with the behavior in this version.

- Fixes the read preference that is sent with read operations to `primaryPreferred` when the driver is connected to a secondary node in the replica set.

- Fixes a memory leak in promise creation for socket operations.

- Reduces first-time connection latency when connecting to a DNS seedlist by querying the `SRV` and `TXT` records in parallel.

- Adds tracking to container metadata when running a client in Kubernetes or a container environment in the `client.env.container` field of the handshake document.

- Adds the original error document returned by the server to the `errorResponse` field of the `MongoServerError` document.

- Deprecates the `CloseOptions` interface which is unused by the driver.

To learn more about this release, see the [v6.5.0 Release Highlights](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.5.0) on GitHub.

## What's New in 6.4

The Node.js driver v6.4 release includes the following features:

- When multiple `mongos` instances are available, different servers are used for read and write retry attempts.

- Caches AWS credentials at the client level, rather than for each authentication.

- Upgrades to using BSON 6.4.0. For details about the new BSON features, see the release notes for [BSON 6.3.0](https://github.com/mongodb/js-bson/releases/tag/v6.3.0) and [BSON 6.4.0.](https://github.com/mongodb/js-bson/releases/tag/v6.4.0)

- Read operations that result in an `ExceededTimeLimit` error are retried.

- Fixes a request issue related to [TLS sockets](https://www.mongodb.com/docs/drivers/node/current/security/tls.md#std-label-node-connect-tls) and [KMS Providers.](https://www.mongodb.com/docs/manual/core/queryable-encryption/fundamentals/kms-providers/)

- Fixes the base64 padding on the `saslContinue` command to allow for mongosh authentication.

- Types `countDocuments` using `Filter<Schema>` rather than `Document`, which enables autocompletion and helps prevent downstream typing issues.

- Fixes a type error in the `$addToSet` option of the `bulkWrite` command. The driver skips `$addToSet` validation you extend your types from `Document` or `any`, or use properties of any type.

- Fixes the `ServerHeartbeatSucceeded` and `ServerHeartbeatFailed` event heartbeat duration so that it does not include the time to create the socket.

- Appropriately emits errors from cursor transform streams, rather than absorbing them.

- Makes AWS session tokens optional when a username and password are provided, and allows AWS SDK to handle the authentication requests.

To learn more about this release, see the [v6.4.0 Release Highlights](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.4.0) on GitHub.

## What's New in 6.3

The Node.js driver v6.3 release includes the following features:

- Adds the `serverMonitoringMode` client option to control the behavior of the monitoring connection among the nodes in a topology. This option takes a value of `auto` (default), `poll`, or `stream`. To learn more, see the entry for this option in the [Specify Connection Options](https://www.mongodb.com/docs/drivers/node/current/connect/connection-options.md#std-label-node-connection-options) guide.

  You can set the `serverMonitoringMode` option in a `MongoClientOptions` instance or as a connection string option. The following example shows how to create a client with the option set to `stream`:

  ```js
  new MongoClient('<connection string>', { serverMonitoringMode: 'stream' });
  ```

- Fixes a connection leak when the `serverApi` client option is set.

- Deprecates the `contentType` and `aliases` GridFS options. To store the content type and aliases of a file, add `contentType` and `aliases` fields to the `metadata` document.

To learn more about this release, see the [v6.3.0 Release Highlights.](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.3.0)

## What's New in 6.2

The Node.js driver v6.2 release includes the following features:

- Updates the `bson` package version to 6.2.0 to include color visualization of types, as shown in the following image:

  ![A screenshot of the terminal that shows printing in color](/_includes/figures/bson-color.png)

  To learn more, see the [bson v6.2.0 release notes.](https://github.com/mongodb/js-bson/releases/tag/v6.2.0)

- Ensures that the `result.insertedIds` property of a bulk write error type contains the `_id` values of successfully inserted documents. In previous versions, when a bulk write operation rejected an insert operation, the `result.insertedIds` property contained the `_id` values for all attempted inserts.

- Closes the implicit session created when running the `findOne()` method on a time series collection regardless of the outcome of the operation.

- Allows the creation of collections that have names that start or end with the `.` character. This change aligns the driver's database and collection name-checking behavior with the server's.

To learn more about this release, see the [v6.2.0 Release Highlights.](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.2.0)

## What's New in 6.1

The Node.js driver v6.1 release includes the following features:

- Updates the `bson` package version to 6.1.0 to expose the `Decimal128.fromStringWithRounding()` method. To learn more, see the [v6.1.0 bson release notes.](https://github.com/mongodb/js-bson/releases/tag/v6.1.0)

- Detects environment variables for region settings when you authenticate by using the [IAM AssumeRoleWithWebIdentity action](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html) with `MONGODB-AWS` authentication. To instruct the driver to use your region options, you must set both of the following environment variables:

  - `AWS_STS_REGIONAL_ENDPOINTS`

  - `AWS_REGION`

  To learn how to set region settings when using the `MONGODB-AWS` authentication mechanism, see the Web Identity Token tab in the [AWS IAM Authentication Mechanism](https://www.mongodb.com/docs/drivers/node/current/security/authentication/aws-iam.md#std-label-node-authentication-aws) guide.

- Fixes a memory leak issue caused by recursive calls to the `next()` method of the `ChangeStream` type.

To learn more about this release, see the [v6.1.0 Release Highlights.](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.1.0)

## What's New in 6.0

**Warning: Breaking Changes in v6.0**

This driver version introduces breaking changes. For a list of these changes, see the [Version 6.0 Breaking Changes section](https://www.mongodb.com/docs/drivers/node/current/reference/upgrade.md#std-label-node-breaking-changes-v6.0) in the Upgrade guide.

The Node.js driver v6.0 release includes the following features:

**Important: Deprecation Notice**

All of the `ssl`-prefixed options in the `MongoClientOptions` type are deprecated. In addition, the `tlsCertificateFile` option is deprecated.

Instead, you should store your certificates in a `SecureContext` object or set the `tls`-prefixed options in your `MongoClientOptions` instance. To learn more, see [Enable TLS on a Connection.](https://www.mongodb.com/docs/drivers/node/current/security/tls.md#std-label-node-connect-tls)

- Removal of support for the `addUser()` helper command. Use the [createUser](https://www.mongodb.com/docs/manual/reference/command/createUser/) MongoDB Shell command instead.

- Removal of support for the `collStats` operation. Use the [$collStats](https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/) aggregation operator instead.

- The `options` field of the `ConnectionPoolCreatedEvent` type contains only the following fields, which are the non-default pool options:

  - `maxConnecting`

  - `maxPoolSize`

  - `minPoolSize`

  - `maxIdleTimeMS`

  - `waitQueueTimeoutMS`

- The driver asynchronously reads files set in the `tlsCAFile` and `tlsCertificateKeyFile` connection options when you call the `MongoClient.connect()` method, not when you create a `MongoClient` instance.

- Removal of the `keepAlive` and `keepAliveInitialDelay` connection options. The value of `keepAlive` is permanently set to `true` and the value of `keepAliveInitialDelay` is set to 300000 milliseconds (300 seconds).

  To learn how to set keepalive settings at a system level, see the [Does TCP keepalive time affect MongoDB Deployments?](https://www.mongodb.com/docs/manual/faq/diagnostics/#does-tcp-keepalive-time-affect-mongodb-deployments-) FAQ entry in the Server manual.

- Removes the following options for the `Db.command()` method:

  - `willRetryWrite`

  - `omitReadPreference`

  - `writeConcern`

  - `explain`

  - `readConcern`

  - `collation`

  - `maxTimeMS`

  - `comment`

  - `retryWrites`

  - `dbName`

  - `authdb`

  - `noResponse`

  Although you cannot pass these options to the `Db.command()` method, you can still set them in the command document. To learn more, see the [Command Options](https://www.mongodb.com/docs/drivers/node/current/run-command.md#std-label-node-command-options) section of the Run a Database Command guide.

To learn more about this release, see the [v6.0.0 Release Highlights.](https://github.com/mongodb/node-mongodb-native/releases/tag/v6.0.0)
