Skip to content

chore(main): release 7.8.0 - #5070

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
release-please--branches--main--components--mongodb
Open

github-actions[bot] wants to merge 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-29)

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

Release Notes

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

  • Adds support for "pass-through" behavior for index options: all index options passed (when opted in) will now be validated by the server rather than the driver. This will become the default behavior in a future major release.
  • Adds an overload for createIndex which separates options for the index from options for the command. This new overload also uses pass-through behavior by default.
  • The original createIndex overload, which retains driver-side options validation, has been deprecated and will be removed in a future major release.
  • Adds an opt-in flag to new passthrough behavior to the createIndexes API. This flag will be removed and pass-through will become the default in a future major release.

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!

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.

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.

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 2 times, most recently from dae7df9 to ef823a5 Compare October 26, 2026 22:55
@github-actions
github-actions Bot force-pushed the release-please--branches--main--components--mongodb branch from ef823a5 to e293d02 Compare October 29, 2026 16:41
@PavelSafronov

Copy link
Copy Markdown
Contributor

run release_notes

This branch has not been deployed

No deployments
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.

1 participant