<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:33 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-987] GridFS.findOne needs a variant that takes a ReadPreference</title>
                <link>https://jira.mongodb.org/browse/JAVA-987</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;For our app we&apos;ve setup a replica set and chosen to use a secondary-preferred read preference to help distribute requests and recover from node failures.  We have the DB configured for secondary preferred and set read preference to primary on a per-request basis - for read and update type operations.&lt;/p&gt;

&lt;p&gt;This fails when dealing with GridFS because their is no ability to provide a read preference in the GridFS API.  I started working on a workaround, reading from the &lt;tt&gt;bucket.fs&lt;/tt&gt; collection and passing the preference that way.&lt;/p&gt;

&lt;p&gt;But now the problem is that when reading file chunks, the input stream is reading from the chunks collection with the database default read preference of secondary-preferred.  Consequently, I&apos;m going to have to reimplement that in our app to get going.  But it sure would be nice if I didn&apos;t have to do that.&lt;/p&gt;</description>
                <environment></environment>
        <key id="92505">JAVA-987</key>
            <summary>GridFS.findOne needs a variant that takes a ReadPreference</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rwallace@atlassian.com">Richard Wallace</reporter>
                        <labels>
                    </labels>
                <created>Thu, 3 Oct 2013 00:54:08 +0000</created>
                <updated>Thu, 3 Sep 2015 19:22:45 +0000</updated>
                            <resolved>Wed, 2 Sep 2015 07:39:06 +0000</resolved>
                                                    <fixVersion>3.1.0</fixVersion>
                                    <component>API</component>
                    <component>GridFS</component>
                                        <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1020279" author="ross@10gen.com" created="Wed, 2 Sep 2015 07:39:06 +0000"  >&lt;p&gt;Fixed in the new GridFS implementation &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1713&quot; title=&quot;Create new GridFS API&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1713&quot;&gt;&lt;del&gt;JAVA-1713&lt;/del&gt;&lt;/a&gt; -The new api has an immutable readPreference but changing it is easy.&lt;/p&gt;</comment>
                            <comment id="435262" author="jeff.yemin" created="Thu, 3 Oct 2013 16:21:21 +0000"  >&lt;p&gt;OK, I&apos;ll keep that in mind.  &lt;/p&gt;</comment>
                            <comment id="435256" author="rwallace@atlassian.com" created="Thu, 3 Oct 2013 16:15:52 +0000"  >&lt;p&gt;It&apos;s not optimal, but it could work.  It would require keeping two GridFS instances: one that uses secondary-preferred and one that uses primary and choosing between the two when making requests. I&apos;d much prefer to just pass the read preference when making requests, but could live with that alternative.&lt;/p&gt;</comment>
                            <comment id="435007" author="jeff.yemin" created="Thu, 3 Oct 2013 02:38:28 +0000"  >&lt;p&gt;Yeah, that&apos;s annoying.  Would it be sufficient for your application to override the read preference per GridFS instance?  Otherwise, there are an awfully large number of methods that would need to be overloaded to take a read preference.&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|hrga6v:</customfieldvalue>

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