-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: CRUD
This ticket was split from DRIVERS-2658, please see that ticket for a detailed description.
Acceptance Criteria
Implementation Details
- Add a new option to the collection's distinct method to allow users to provide a hint. When provided, this sets the `hint` field on the distinct command.
- `hint` can be either a string (index name) or a document (index key pattern).
- If no hint is provided, no hint should be attached to the command.
Testing Requirements
- All existing tests pass.
- Sync new distinct tests.
Add test that demonstrates that hint is not added to the command when it is not provided as an option.- Note: this has been removed from the scope of the ticket. On <7.1 servers, attaching a hint always fails. On 7.1+ servers, the server throws because the hint is not an object or string. So, if the driver accidentally always attached a hint, we'd get errors on all server versions.