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.