Skip to content

Conversation

@dariakp
Copy link
Contributor

@dariakp dariakp commented Oct 22, 2025

Description

Summary of Changes

Adds a V7 migration guide and updates the README for V7, including the compat table.

What is the motivation for this change?

NODE-7172

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • [N/A] Changes are covered by tests
  • [N/A] New TODOs have a related JIRA ticket

@dariakp dariakp marked this pull request as ready for review October 23, 2025 00:46
@dariakp dariakp requested a review from a team as a code owner October 23, 2025 00:46
@dariakp dariakp changed the title docs(NODE-7172): create v7 migration guide [DO NOT MERGE] docs(NODE-7172): create v7 migration guide Oct 23, 2025
durran
durran previously approved these changes Oct 23, 2025

## ⚠️ ALL BREAKING CHANGES

- **NODE-7259:** use alphas of all supporting packages ([#4746](https://github.com/mongodb/node-mongodb-native/issues/4746))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder: Replace this line with link to actual major version bumps

Co-authored-by: Alex Bevilacqua <[email protected]>
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor comments.

Comment on lines 65 to 69
| Dependency | Allowed Range | Previous Range |
| ----------------------------- | ------------- | -------------- |
| @aws-sdk/credential-providers | ^3.806.0 | ^3.188.0 |
| gcp-metadata | ^7.0.1 | ^5.2.0 |
| socks | ^2.8.6 | ^2.7.1 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but suggest swapping the allowed and previous range columns. English reads right -> left, and people (myself included) might skip the headers and be confused why it seems like we're lowering version requirements if they just skim the table.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, done


### Explicitly provided credentials no longer accepted with MONGODB-AWS authentication

AWS environments (such as AWS Lambda) do not have credentials that are permanent and expire within a set amount of time. Providing credentials in the URI or options would mandate that those credentials would be valid for the life of the `MongoClient`, which is problematic. With this change, the installed required AWS SDK will now fetch credentials using the environment, endpoints, or a custom credential provider.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AWS environments (such as AWS Lambda) do not have credentials that are permanent and expire within a set amount of time. Providing credentials in the URI or options would mandate that those credentials would be valid for the life of the `MongoClient`, which is problematic. With this change, the installed required AWS SDK will now fetch credentials using the environment, endpoints, or a custom credential provider.
AWS environments (such as AWS Lambda) do not have credentials that are permanent and expire within a set amount of time. Providing credentials in the URI or options would mandate that those credentials would be valid for the life of the `MongoClient`, which is problematic. With this change, the installed required AWS SDK will now fetch credentials using a custom credential provider or the AWS SDK.

Suggest removing all mention of what the SDK supports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rephrased, let me know what you think


const client = new MongoClient('mongodb<+srv>://<host>:<port>/?authMechanism=MONGODB-AWS');
```
The previous method of providing URI encoded credentials based on the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` directly in the connection string will no longer work.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The previous method of providing URI encoded credentials based on the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` directly in the connection string will no longer work.
The previous method of providing URI encoded credentials based on the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` directly in the connection string will no longer work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed spacing


## 💥 Misc breaking improvements

### Change streams no longer whitelist `$changeStream` stage options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Change streams no longer whitelist `$changeStream` stage options
### Change streams no longer allowlist `$changeStream` stage options

allowlist / denylist instead of whitelist / blacklist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, though in this case I think "filters" is more apt anyway


### Change streams no longer whitelist `$changeStream` stage options

Uses are now able to pass any option to `collection.watch()` and if it is invalid in the `$changeStream` stage of the pipeline the server will error. This is to allow users to provide newly added options quickly that are not in our public types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Uses are now able to pass any option to `collection.watch()` and if it is invalid in the `$changeStream` stage of the pipeline the server will error. This is to allow users to provide newly added options quickly that are not in our public types.
Uses are now able to pass any option to `collection.watch()` and if it is invalid in the `$changeStream` stage of the pipeline the server will error.

Minor, but we really only intend for internal users to encounter this through mongosh, right? Suggest removing all mention of using unsupported options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted the wording, I think it's still worthwhile to call out motivation for changes in our release notes; in this case, unknown to the driver and unsupported aren't the same thing


### Internal `ClientMetadata` properties have been removed

Previous versions of the driver unintentionally made properties used when constructing client metadata public. These properties have now been made internal. The full list of properties is:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Previous versions of the driver unintentionally made properties used when constructing client metadata public. These properties have now been made internal. The full list of properties is:
Previous versions of the driver unintentionally made driver-internal properties handshake construction properties. These properties have now been made internal. The full list of properties is:

the phrasing of the sentence feels odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, revised for flow

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants