Skip to content

chore(main): release 7.8.0 - #5070

Merged
dariakp merged 1 commit into
mainfrom
release-please--branches--main--components--mongodb
Oct 30, 2026
Merged

dariakp merged 1 commit into
mainfrom
release-please--branches--main--components--mongodb

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🌱 A new release!

7.8.0 (2026-10-30)

The MongoDB Node.js team is pleased to announce version 7.8.0 of the mongodb package!

Release Notes

timeoutMS is deprecated and now a no-op

Warning

timeoutMS and timeoutMode are deprecated and have no effect starting in this release. They are still accepted and will not throw, but operations will no longer time out because of them. They are slated for removal in a future release.

Use the per-stage timeouts instead: serverSelectionTimeoutMS, waitQueueTimeoutMS, socketTimeoutMS, and maxTimeMS for server-side execution.

Configurable SRV host validation

This release adds two new methods of validating DNS:

  1. srvAllowedHostsSuffix - A host name suffix that every host returned by the SRV lookup must end with. This option can be configured on the client or the connection string.
  2. srvHostValidator - A synchronous function that decides whether a host returned by the SRV lookup may be used. This option can only be configured on the client. This function must accept a string and has to return a boolean; returning anything else, including the Promise returned by an async function, will result in an error.

Warning

Modifying the default SRV domain name validation can create vulnerabilities.

SRV host names are now compared in a normalized form (case-insensitively, without a trailing dot, and with internationalized names in xn-- form). Connection strings whose SRV host name differs in case from the host names returned by DNS, such as mongodb+srv://TEST1.TEST.BUILD.10GEN.CC, previously failed SRV verification and now connect.

zstd compression no longer requires @mongodb-js/zstd on Node.js 22.15.0+

The driver now uses Node.js' built-in zstd implementation when it is available. On older Node.js versions it continues to use @mongodb-js/zstd, so no changes are needed for existing setups.

Thanks to @axelonet for the original contribution!

Distinguish between command-level options and index-level options when creating indexes

Before:

// Index options and command options were on the same object
await collection.createIndex(
  { email: 1 },
  {
    // index options
    unique: true,
    name: 'email_unique',
    // command options
    commitQuorum: 'majority',
    maxTimeMS: 5000
  }
);

After:

await collection.createIndex(
  { email: 1 },
  // Argument 2: options that describe the index itself
  { unique: true, name: 'email_unique' },
  // Argument 3: options for the createIndexes command
  { commitQuorum: 'majority', maxTimeMS: 5000 }
);

Both overloads will be supported for now. In a future major release, the two parameter overload will be removed.

Enjoy faster adoption of new index options

Before:

// The driver only forwarded options present in allow list.
// `newIndexOption` was silently dropped and never reached the server.
await collection.createIndex({ location: '2dsphere' }, { newIndexOption: true });

// But! `nonexistentIndexOption` was also removed and so the server never threw an error
await collection.createIndex({ location: '2dsphere' }, { nonexistentIndexOption: true });

After:

// Index options are passed to the server as written.
// This means you can use a new option supported by the server without waiting
// for the driver to add it to an allow list!
await collection.createIndex(
  { location: '2dsphere' },
  { newIndexOption: true },
  undefined
);

// But! it also means the driver will no longer prevent a bad option either
await collection.createIndex(
  { location: '2dsphere' },
  { nonexistentIndexOption: true }, // throws
  undefined
);

The two-parameter overload will continue to filter for valid index options. In a future major release, the two parameter overload will be removed.

Removed @experimental tags from features which are no-longer experimental

No-longer experimental entities:

  • DropCollectionOptions.encryptedFields
  • CreateCollectionOptions.encryptedFields
  • ClientEncryptionCreateDataKeyProviderOptions.keyMaterial
  • ClientEncryptionRewrapManyDataKeyProviderOptions
  • ClientEncryptionRewrapManyDataKeyResult

Alongside these changes is also a change to the return type of rewrapManyDataKey to ClientEncryptionRewrapManyDataKeyResult from an anonymous type. This improves internal type consistency and public api clarity without changing runtime behavior.

Sorting by $meta with a [field, direction] pair now works

Previously, passing a $meta sort direction in the [field, direction] form, for example cursor.sort(['score', { $meta: 'textScore' }]), threw MongoInvalidArgumentError: Invalid sort direction. The object form ({ score: { $meta: 'textScore' } }) and the nested array form ([['score', { $meta: 'textScore' }]]) already worked, so the same sort was accepted or rejected depending on how it was written. All three forms now behave the same.

Thanks to @spokodev for the fix!

Fix bulk write result insertedIds mismatches on bulkwrites with mixed op types

For unordered bulk writes that mixed inserts with updates or deletes, BulkWriteResult.insertedIds was keyed by a running count of inserts, not by each insert's index in the operations list. It's now keyed by the operation index, which matches ordered bulk writes and the documentation.

Thanks to @spokodev for this fix!

GridFS queries match file IDs exactly

GridFS download, delete, rename and upload abort now query by file ID with $eq. Nothing changes for normal IDs, but you'll see { _id: { $eq: <id> } } in command monitoring and logs.

hello commands are no longer compressed

When compressors was configured, the driver could send hello and isMaster on monitoring connections as compressed messages, which the compression specification forbids. These commands are now never compressed.

Features

Bug Fixes

Documentation

We invite you to try the mongodb library immediately, and report any issues to the NODE project.


@github-actions
github-actions Bot requested a review from a team as a code owner October 2, 2026 18:36
@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch 2 times, most recently from b84e9c8 to 24f5768 Compare October 7, 2026 21:11
@github-actions github-actions Bot changed the title chore(main): release 7.7.1 chore(main): release 7.8.0 Oct 7, 2026
@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch 4 times, most recently from 800781f to 30303a3 Compare October 9, 2026 10:09
@PavelSafronov

Copy link
Copy Markdown
Contributor

run release_notes

@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch from 30303a3 to d51cd72 Compare October 15, 2026 09:25
@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch 3 times, most recently from ef823a5 to e293d02 Compare October 29, 2026 16:41
@PavelSafronov

Copy link
Copy Markdown
Contributor

run release_notes

@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch from e293d02 to a5f31ed Compare October 29, 2026 22:29
@PavelSafronov

Copy link
Copy Markdown
Contributor

run release_notes

@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch from a5f31ed to 041a18c Compare October 30, 2026 01:30
@tadjik1

tadjik1 commented Oct 30, 2026

Copy link
Copy Markdown
Member

run release_notes

@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch from 041a18c to 510042e Compare October 30, 2026 11:56
@dariakp
dariakp merged commit c406cab into main Oct 30, 2026
34 of 36 checks passed
@dariakp
dariakp deleted the release-please--branches--main--components--mongodb branch October 30, 2026 16:23
@github-actions

Copy link
Copy Markdown
Contributor Author

🤖 Created releases:

🌻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants