unstale

npm / mongodb

mongodb

What changed in mongodb 6 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.

52 breaking7 deprecations7 new APIs and options1 performance16 behavior and defaults9 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

mongodb 788 changes

Breaking changes 51

  • The driver no longer supports MongoDB 4.2 or older servers and throws an error when connecting to them.

    7.6.0release notes

  • Closing a client now closes checked-out connections across all servers, interrupting in-flight operations promptly.

    7.5.0release notes

  • String replaces the TextPreview algorithm for Queryable Encryption string queries.

    7.5.0release notes

  • StringOpts replaces TextOpts for Queryable Encryption string queries.

    7.5.0release notes

  • On replica sets, server deprioritization is restricted to overload errors.

    7.2.0release notes

  • Wildcard matching now requires full subdomain or path matches, preventing partial suffix matches from being accepted.

    7.1.1release notes

  • Aggregate with write concern and explain now throws a MongoServerError instead of throwing client-side.

    7.0.0release notes

  • TypeScript now restricts the filename to the default crypt_shared library name or a path ending in that filename.

    7.0.0release notes

  • TypeScript now restricts the filename to the default mongocryptd name or a path ending in that filename.

    7.0.0release notes

  • This package is now required for MONGODB-AWS authentication.

    7.0.0release notes

  • The beta namespace was removed; resource management moved into the driver.

    7.0.0release notes

  • The deprecated CancellationToken type has been removed.

    7.0.0release notes

  • The deprecated ClientMetadataOptions type has been removed.

    7.0.0release notes

  • The deprecated transaction property has been removed from ClientSession.

    7.0.0release notes

  • The deprecated CloseOptions type has been removed.

    7.0.0release notes

  • retryWrites has been removed from CommandOperationOptions; it is a global MongoClient option.

    7.0.0release notes

  • The noResponse option has been removed; it was never intended for public APIs and did not work properly.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • The deprecated autoIndexId option has been removed.

    7.0.0release notes

  • Dropping a collection returns false instead of throwing when the namespace is not found.

    7.0.0release notes

  • The deprecated batchSize option has been removed from FindOneOptions.

    7.0.0release notes

  • The deprecated limit option has been removed from FindOneOptions.

    7.0.0release notes

  • The deprecated noCursorTimeout option has been removed from FindOneOptions.

    7.0.0release notes

  • FindOptions no longer accepts a generic type parameter.

    7.0.0release notes

  • Cursors no longer set a default batchSize of 1000 for getMore; it is set only when explicitly configured for the cursor.

    7.0.0release notes

  • The deprecated aliases option has been removed.

    7.0.0release notes

  • The deprecated contentType option has been removed.

    7.0.0release notes

  • The deprecated aliases property has been removed.

    7.0.0release notes

  • The deprecated contentType property has been removed.

    7.0.0release notes

  • The optional peer dependency minimum version is 7.0.0; support for version 2.x is dropped.

    7.0.0release notes

  • connect now runs a handshake regardless of whether credentials are defined, making fail-fast precondition checks more consistent across environments.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • The deprecated useNewUrlParser option has been removed.

    7.0.0release notes

  • The deprecated useUnifiedTopology option has been removed.

    7.0.0release notes

  • The driver now uses bson@7.0.0; BSON functionality re-exported from the driver is subject to the BSON V7 release-note changes.

    7.0.0release notes

  • Explicit credentials in the URI or options are no longer accepted; AWS credentials are fetched through the required AWS SDK.

    7.0.0release notes

  • The optional peer dependency minimum version is raised to 7.0.0, dropping support for 6.x.

    7.0.0release notes

  • The unsupported MONGODB-CR authentication mechanism has been removed.

    7.0.0release notes

  • The optional peer dependency minimum version is 7.0.0; support for versions 1.x and 2.x is dropped.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • This internal ClientMetadata property is no longer exposed in the public API.

    7.0.0release notes

  • The deprecated minWireVersion property has been removed.

    7.0.0release notes

  • The deprecated ResumeOptions type has been removed.

    7.0.0release notes

  • The deprecated ServerCapabilities type has been removed.

    7.0.0release notes

  • Cursor and ChangeStream stream() no longer accepts a transform function; ReadableStream.map() can be used instead.

    7.0.0release notes

  • MongoClient, ClientSession, ChangeStream, and cursors implement Symbol.asyncDispose for explicit resource management; this support is experimental.

    7.0.0release notes

  • The deprecated Transaction type has been removed.

    7.0.0release notes

Deprecations 4

  • The prefixPreview query type is deprecated and will be removed in a future release.

    7.5.0release notes

  • The substringPreview query type is deprecated and will be removed in a future release.

    7.5.0release notes

  • The suffixPreview query type is deprecated and will be removed in a future release.

    7.5.0release notes

  • The unused new_collection option is deprecated and can be safely removed with no behavioral change.

    7.1.0release notes

New APIs and options 7

  • Support was added for baseBackoffMS alongside an update to client backpressure backoff.

    7.6.0release notes

  • Set this callback on ClientEncryption or auto-encryption options to connect to KMS hosts through an HTTP proxy; the driver performs the KMS TLS handshake over the returned socket.

    7.6.0release notes

  • Returns the number of documents remaining in the change stream from the last batch, allowing callers to check for buffered documents before invoking async methods.

    7.2.0release notes

  • The token bucket is optional in client backpressure.

    7.2.0release notes

  • When enabled, the driver deprioritizes servers that return overload errors during retry server selection; defaults to false.

    7.2.0release notes

  • Configures the maximum number of retries during server overload; defaults to 2, and 0 disables overload retries.

    7.2.0release notes

  • Experimental MongoClient option for injecting core Node.js APIs, including the os module, for alternative runtimes or restricted environments.

    7.2.0release notes

Performance 1

  • insertMany and bulkWrite serialize each document once and reuse the resulting bytes for batch sizing and commands, reducing BSON-encoding CPU and event-loop blocking.

    7.6.0release notes

Behavior and default changes 16

  • The driver retries overload errors only when a retry is expected not to worsen server conditions, improving performance for MongoDB 9.0's Intelligent Workload Management.

    7.6.0release notes

  • The prefix query type is now generally available for Queryable Encryption string queries.

    7.5.0release notes

  • The substring query type is now generally available for Queryable Encryption string queries.

    7.5.0release notes

  • The suffix query type is now generally available for Queryable Encryption string queries.

    7.5.0release notes

  • The async disposal methods on MongoClient, ClientSession, ChangeStream, and cursors are now officially supported, enabling await using for automatic cleanup without experimental flags.

    7.4.0release notes

  • The maximum wire version and maximum server version were bumped to 29 in preparation for MongoDB LTS (v9.0).

    7.3.0release notes

  • Retry loops use exponential backoff and jitter.

    7.2.0release notes

  • The driver uses standard Uint8Array APIs and globalThis.crypto instead of Node-specific Buffer and crypto APIs, improving compatibility with non-Node.js runtimes.

    7.2.0release notes

  • The default OIDC allowed-host list now supports hosts matching *.mongo.com.

    7.1.0release notes

  • The driver replaces Node-specific APIs with standards-based equivalents and explicitly imports node:process, improving compatibility with alternate runtimes.

    7.1.0release notes

  • Connection establishment failures no longer clear the pool, preventing unnecessary connection churn when server-side connection rate limiting rejects requests.

    7.1.0release notes

  • When retrying a command, server selection deprioritizes servers to improve stability and reduce repeated targeting of overloaded or previously failed servers.

    7.1.0release notes

  • A custom AWS credential provider now takes the highest precedence over other AWS authentication methods.

    7.0.0release notes

  • Change streams no longer filter $changeStream stage options, allowing options to reach the server even before they are in public type definitions.

    7.0.0release notes

  • close only attempts session cleanup when the topology supports sessions.

    7.0.0release notes

  • Errors thrown during encryption are now subclasses of MongoError.

    7.0.0release notes

Fixes and other changes 9

  • A failed OIDC token fetch now affects only the operation that triggered it; later operations can attempt a new token fetch without restarting the process.

    7.7.0release notes

  • The default os adapter now loads through dynamic import, so constructing a MongoClient in bundled ESM output no longer throws ReferenceError: require is not defined.

    7.6.0release notes

  • Write operations in causally consistent sessions now include readConcern.afterClusterTime, maintaining the “read your own writes” guarantee across primary failovers in sharded clusters.

    7.4.0release notes

  • Explicit UTF-8 string conversion fixes SCRAM authentication in non-Node.js environments such as Deno and other web-compatible runtimes.

    7.3.0release notes

  • The driver now applies TCP keep-alive and no-delay settings after TLS socket creation, preventing settings from being silently ignored.

    7.1.1release notes

  • OIDC reauthentication now succeeds when MongoClient is configured with promoteValues: false.

    7.1.0release notes

  • Aggregations using $merge or $out now respect secondary and secondaryPreferred read preferences instead of forcing execution on the primary.

    7.1.0release notes

  • The options parameter is now correctly marked optional in the TypeScript definition.

    7.0.0release notes

  • The PoolClearedError error label typo is fixed from PoolRequstedRetry to PoolRequestedRetry.

    7.0.0release notes

mongodb 64 changes

Breaking changes 1

  • The transform option is deprecated and removed in favor of Stream#map; CursorStreamOptions will be removed in 7.0.0.

    6.21.0release notes

Deprecations 3

  • noResponse is deprecated as unused and will be removed in 7.0.0.

    6.21.0release notes

  • cancellationToken is deprecated as unused and will be removed in 7.0.0.

    6.21.0release notes

  • AWS_SESSION_TOKEN is deprecated and will be removed in 7.0.0; URI and client options for AWS variables will no longer be respected.

    6.21.0release notes