Skip to content

fix: allow hint with distinct - #143

Open
BCHAYMAE wants to merge 1 commit into
mongoosejs:masterfrom
BCHAYMAE:fix-distinct-hint
Open

BCHAYMAE wants to merge 1 commit into
mongoosejs:masterfrom
BCHAYMAE:fix-distinct-hint

Conversation

@BCHAYMAE

@BCHAYMAE BCHAYMAE commented Nov 4, 2026

Copy link
Copy Markdown

Description

This PR allows the use of hint() with distinct() queries.

Previously, hint() was explicitly forbidden when using distinct(). This restriction has been removed so that index hints can be passed as part of the distinct query options.

Changes

  • Removed the restriction on hint in lib/permissions.js.
  • Updated the hint() documentation to remove the outdated restriction.
  • Updated tests to verify that hint() can be used with distinct().

Testing

  • npm test — 465 passing, 3 pending.
  • npm run lint — passed.

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.

1 participant