Skip to content

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Oct 7, 2025

Description

Summary of Changes

This PR makes all metadata properties in the driver internal. Additionally, it removes some unnecessary properties (additionalDriverInfo, extendedMetadata) in favor of metadata.

I also took this opportunity to clean up the client metadata module. Specifically:

  • addContainerMetadata is now internal to the module and called by makeClientMetadata. The only reason we exported this function and called it separate from makeClientMetadata was that MongoClient.options.metadata was public, which meant that we could not change the type from ClientMetadata -> Promise<ClientMetadata>.
  • Now that interface ClientMetadata is internal, I updated it so that it matches the specification.
Notes for Reviewers

What is the motivation for this change?

Release Highlight

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:

MongoClient.options.additionalDriverInfo
MongoClient.options.metadata
MongoClient.options.extendedMetadata
MongoOptions.additionalDriverInfo
MongoOptions.metadata
MongoOptions.extendedMetadata
ConnectionOptions.metadata
ConnectionOptions.extendedMetadata

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
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@baileympearson baileympearson marked this pull request as ready for review October 8, 2025 14:55
@baileympearson baileympearson requested a review from a team as a code owner October 8, 2025 14:55
@durran durran self-assigned this Oct 8, 2025
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Oct 8, 2025
@durran durran merged commit b59c5ce into main Oct 9, 2025
27 checks passed
@durran durran deleted the NODE-5994 branch October 9, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants