Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4281

Unable to specify an index hint using a String in legacy driver 4.3

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0
    • Affects Version/s: None
    • Component/s: Legacy API
    • Labels:

      Hi there,

      We are currently attempting to upgrade a the Clojure MongoDB driver from Java driver 3.12 to 4.3. We have hit a problem trying to specify the index to use by name when issuing a find command.

      We are being very careful and trying to ensure that we do not break the API.

      We have a com.mongodb.DBCollection object, and we are attempting to call .find, in such a way that we can also specify an index hint using the String name of the index.

      The previous code called the .hint function that takes a String argument, the name of the index.

      I can't find a way to achieve the same result in the 4.3 legacy driver.

      The .find function on DBCollection doesn't accept a hint. It returns a DBCursor though.

      I can set a hint on the DBCursor, but this artity only accepts a sequence of DB keys as the hint, not the string name of the index.


            jeff.yemin@mongodb.com Jeffrey Yemin
            marc@circleci.com Marc O'Morain
            0 Vote for this issue
            2 Start watching this issue