mongodb breaking changes
Updated December 4, 2026
On this page
Latest version 7.10.0, released December 3, 2026. Source repository
Its 7.0.0 release requires Node.js 20.19.0 or later. Node.js end of life dates.
- From 6.22.0 to 7.9.1: 128 breaking changes in 9 versions.
- From 5.0.0 to 7.9.1: 245 breaking changes in 11 versions.
mongodb 7.9.1 breaking changes
- Behavior changed
MongoClient
Credentials with a NUL character, from the connection string or the options object, now make the MongoClient constructor throw. Remove NUL characters from PLAIN credentials before creating the client. github.com
mongodb 7.9.0 breaking changes
- Behavior changed
dropIndexes
dropIndexes no longer swallows most errors; only NamespaceNotFound is ignored, and other errors are thrown. Code that relied on silent failures must handle them. github.com - Behavior changed
MongoClient
Passing an environment and an OIDC callback together, in the connection string or options, now fails. Remove one of them so the client uses only one authentication source. github.com - Default changed
autoSelectFamily
When unset, the driver no longer forces autoSelectFamily to true, so the runtime default applies. On runtimes other than Node.js this default may differ; set the option explicitly to keep the old behavior. github.com - Signature changed
Collection.createIndex
Was createIndex(indexSpec: IndexSpecification, options?: CreateIndexesOptions): Promise<string>; now createIndex(indexSpec: IndexSpecification): Promise<string> createIndex(indexSpec: IndexSpecification, options: CreateIndexesOptions |... npmjs.com
mongodb 7.8.0 breaking changes
- Signature changed
AbstractCursor.close
Was close(options?: {timeoutMS?: number;}): Promise<void>; now close(_options?: {timeoutMS?: number;}): Promise<void>. npmjs.com - Signature changed
ClientEncryption.rewrapManyDataKey
Was rewrapManyDataKey(filter: Filter<DataKey>, options?: ClientEncryptionRewrapManyDataKeyProviderOptions): Promise<{bulkWriteResult?: BulkWriteResult;}>; now rewrapManyDataKey(filter: Filter<DataKey>, options?... npmjs.com - Signature changed
ClientSession.commitTransaction
Was commitTransaction(options?: {timeoutMS?: number;}): Promise<void>; now commitTransaction(_options?: {timeoutMS?: number;}): Promise<void>. npmjs.com - Signature changed
Collection.createIndexes
Was createIndexes(indexSpecs: IndexDescription[], options?: CreateIndexesOptions): Promise<string[]>; now createIndexes(indexSpecs: IndexDescription[], commandOptions: CreateIndexesOptions | undefined, allowUnknownIndexOptions: boolean)... npmjs.com - Signature changed
GridFSBucket.delete
Was delete(id: ObjectId, options?: {timeoutMS: number;}): Promise<void>; now delete(id: ObjectId, options?: {timeoutMS?: number;}): Promise<void>. npmjs.com - Signature changed
GridFSBucket.drop
Was drop(options?: {timeoutMS: number;}): Promise<void>; now drop(options?: {timeoutMS?: number;}): Promise<void>. npmjs.com - Signature changed
GridFSBucket.rename
Was rename(id: ObjectId, filename: string, options?: {timeoutMS: number;}): Promise<void>; now rename(id: ObjectId, filename: string, options?: {timeoutMS?: number;}): Promise<void>. npmjs.com
mongodb 7.6.0 breaking changes
- Removed
The driver now throws an error when connecting to a MongoDB server of version 4.2 or less. Upgrade the server to 4.4 or later before upgrading the driver. github.com
mongodb 7.5.0 breaking changes
- Renamed
TextOpts
The TextOpts API was replaced with StringOpts when Queryable Encryption string queries became generally available. Update code that uses TextOpts to use StringOpts. github.com - Renamed
TextPreview
The TextPreview algorithm was replaced with String when Queryable Encryption string queries became generally available. Use String in place of TextPreview. github.com - Behavior changed
MongoClient.close
MongoClient.close() now closes checked-out connections on every server, so in-flight operations on other servers are interrupted with MongoClientClosedError. Code that relied on those operations finishing after close must handle this error. github.com - Signature changed
ClientEncryptionEncryptOptions.algorithm
Was algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range' | 'TextPreview'; now algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' |... npmjs.com - Signature changed
ClientEncryptionEncryptOptions.queryType
Was queryType?: 'equality' | 'range' | 'prefixPreview' | 'suffixPreview' | 'substringPreview'; now queryType?: 'equality' | 'range' | 'prefix' | 'suffix' | 'substring' | 'prefixPreview' | 'suffixPreview' | 'substringPreview'. npmjs.com - Signature changed
ClientEncryptionEncryptOptions.textOptions
Was textOptions?: TextQueryOptions; now textOptions?: StringQueryOptions. npmjs.com - Signature changed
TextQueryOptions
Was interface TextQueryOptions; now type TextQueryOptions = StringQueryOptions. npmjs.com
mongodb 7.2.0 breaking changes
- Behavior changed
Retries now wait progressively longer between attempts, with randomized jitter, so retry timing changes for existing code. github.com - Signature changed
GridFSBucketWriteStream.bufToStore
Was bufToStore: Buffer; now bufToStore: Uint8Array. npmjs.com - Signature changed
MongoOptions
Was interface MongoOptions extends Required<Pick<MongoClientOptions, 'autoEncryption' | 'connectTimeoutMS' | 'directConnection' | 'driverInfo' | 'forceServerObjectId' | 'minHeartbeatFrequencyMS' | 'heartbeatFrequencyMS' |... npmjs.com
Older versions
6 older versions, each with its first changes. Sign up to see every change
Show 6 older versions
mongodb 7.1.1 breaking changes
- Configuration changed
Wildcard entries *. and */ in OIDC ALLOWED_HOSTS now need full subdomain or path matches, so partial suffix matches that were previously accepted are rejected. Check that your allowed host entries match exactly. github.com
mongodb 7.1.0 breaking changes
- Removed
SelectServerOptions.previousServer
SelectServerOptions.previousServer was removed in mongodb 7.1.0 npmjs.com - Behavior changed
withTransaction
The convenient transaction API now uses exponential backoff between retries when a transaction must be retried, so retry timing changes. github.com
And 1 more in this version.
mongodb 7.0.0 breaking changes
- Removed
The driver now requires Node.js v20.19.0 or later. Upgrade the Node.js runtime before adopting v7. github.com - Removed
Use authMechanism=MONGODB-AWS only; credentials are fetched by the AWS SDK. github.com
And 99 more in this version.
mongodb 6.22.0 breaking changes
- Behavior changed
timeoutMS
Operations no longer time out because of timeoutMS, so code relying on it for timeouts must use the per-stage timeout options instead. github.com - Signature changed
AbstractCursor.close
Was close(options?: {timeoutMS?: number;}): Promise<void>; now close(_options?: {timeoutMS?: number;}): Promise<void>. npmjs.com
And 4 more in this version.
mongodb 6.0.0 breaking changes
- Removed
Older Node.js runtimes are no longer supported; upgrade Node.js to v16.20.1 or later. github.com - Removed
AddUserOptions
AddUserOptions type removed in mongodb 6.0.0 npmjs.com
And 109 more in this version.
mongodb 5.0.0 breaking changes
- Removed
The driver no longer automatically uses bson-ext in place of the bson dependency. github.com - Removed
Callback arguments are no longer accepted by driver methods. Migrate to Promises, or use the mongodb-legacy package to keep callbacks. github.com
And 170 more in this version.
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.