Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NODE-6494): add support for hint on distinct commands #4487

Merged
merged 3 commits into from
Mar 26, 2025

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Mar 25, 2025

Description

What is changing?

Distinct commands now support hint.

Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

distinct commands now support an index hint

Important

Driver support for server 4.0 will be removed in an upcoming minor release.

The Collection.distinct() method now supports an optional hint, which can be used to tell the server which index to use for the command:

// providing an index description
await collection.distinct('my-key', { 
  hint: { 'my-key': 1 }
});

// providing an index name
await collection.distinct('my-key', { 
  hint: 'my-key'
});

This requires server 7.1+.

Double check the following

  • Ran npm run check:lint script
  • 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 changed the title add support for distinct feat(NODE-6494): add support for hint on distinct commands Mar 25, 2025
@baileympearson baileympearson marked this pull request as ready for review March 25, 2025 22:13
@baileympearson baileympearson requested a review from a team as a code owner March 25, 2025 22:13
@nbbeeken nbbeeken self-assigned this Mar 26, 2025
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 26, 2025
@nbbeeken nbbeeken merged commit 40d0e87 into main Mar 26, 2025
27 of 30 checks passed
@nbbeeken nbbeeken deleted the NODE-6494-distinct-hint branch March 26, 2025 14:42
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.

2 participants