Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-6494

Add index hint support for distinct command

    • 2
    • Hide

      DRIVERS-2658:
      Summary of necessary driver changes

      • Add hint to DistinctOptions.

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      Context for other referenced/linked tickets

      •  
      Show
      DRIVERS-2658: Summary of necessary driver changes Add hint to DistinctOptions . Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed) Sync CRUD unified spec tests to  77b1f78458cf25b525cde2274e33acd5db2581d2 See the Go Driver implementation for reference: https://github.com/mongodb/mongo-go-driver/pull/1888 Context for other referenced/linked tickets  
    • Not Needed
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            dbeng-pm-bot TPM Jira Automations Bot
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None