<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:01:40 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-4281] Unable to specify an index hint using a String in legacy driver 4.3</title>
                <link>https://jira.mongodb.org/browse/JAVA-4281</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;We are currently attempting to upgrade a the &lt;a href=&quot;https://github.com/congomongo/congomongo&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Clojure MongoDB driver&lt;/a&gt; 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.&lt;/p&gt;

&lt;p&gt;We are being very careful and trying to ensure that we do not break the API.&lt;/p&gt;

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

&lt;p&gt;The previous code called the &lt;a href=&quot;https://mongodb.github.io/mongo-java-driver/3.12/javadoc/com/mongodb/DBCursor.html#hint(java.lang.String)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;.hint&lt;/tt&gt;&lt;/a&gt; function that takes a &lt;tt&gt;String&lt;/tt&gt; argument, the name of the index.&lt;/p&gt;

&lt;p&gt;I can&apos;t find a way to achieve the same result in the 4.3 legacy driver.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://mongodb.github.io/mongo-java-driver/4.3/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#find(com.mongodb.DBObject,com.mongodb.DBObject)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;.find&lt;/a&gt; function on DBCollection doesn&apos;t accept a hint. It returns a DBCursor though.&lt;/p&gt;

&lt;p&gt;I &lt;a href=&quot;https://mongodb.github.io/mongo-java-driver/4.3/apidocs/mongodb-driver-legacy/com/mongodb/DBCursor.html#hint(com.mongodb.DBObject)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;can set a hint&lt;/a&gt; on the DBCursor, but this artity only accepts a sequence of DB keys as the hint, not the string name of the index.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1857987">JAVA-4281</key>
            <summary>Unable to specify an index hint using a String in legacy driver 4.3</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="marc@circleci.com">Marc O&apos;Morain</reporter>
                        <labels>
                            <label>external-user</label>
                    </labels>
                <created>Mon, 23 Aug 2021 14:21:34 +0000</created>
                <updated>Sat, 28 Oct 2023 11:21:04 +0000</updated>
                            <resolved>Fri, 15 Oct 2021 11:59:03 +0000</resolved>
                                                    <fixVersion>4.4.0</fixVersion>
                                    <component>Legacy API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4030163" author="JIRAUSER1262029" created="Mon, 30 Aug 2021 20:56:12 +0000"  >&lt;p&gt;That would be great, thanks Jeffrey.&lt;/p&gt;</comment>
                            <comment id="4030149" author="jeff.yemin" created="Mon, 30 Aug 2021 20:51:10 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=marc%40circleci.com&quot; class=&quot;user-hover&quot; rel=&quot;marc@circleci.com&quot;&gt;marc@circleci.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for bringing this to our attention.  It does indeed look like a mistake that this method was deprecated.  Unfortunately, I don&apos;t see a good workaround using the 4.3 driver.  &lt;/p&gt;

&lt;p&gt;The best I can offer is that we add the method back in the next minor release (4.4.0), which will be cut in about six weeks.  Will that work for you?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzix6n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>