<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:58 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-1180] Inconsistent behaviour when querying GridFS collection</title>
                <link>https://jira.mongodb.org/browse/JAVA-1180</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;When querying a GridFS collection on specific fields, it works when no GridFS file was ever stored on that collection. Once a file was saved to the collection, the query on specific fields fails with &quot;can&apos;t load partial GridFSFile file&quot;.&lt;/p&gt;

&lt;p&gt;Probably the driver uses &apos;BasicDBObject&apos; for the query until it associates GridFS with the collection?&lt;/p&gt;</description>
                <environment>Mac OS X</environment>
        <key id="133306">JAVA-1180</key>
            <summary>Inconsistent behaviour when querying GridFS collection</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="tspindler@gmail.com">Torsten Spindler</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Apr 2014 11:40:22 +0000</created>
                <updated>Tue, 16 Nov 2021 14:25:14 +0000</updated>
                            <resolved>Mon, 28 Apr 2014 16:46:08 +0000</resolved>
                                    <version>2.12.0</version>
                                                    <component>GridFS</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="565614" author="ross@10gen.com" created="Mon, 28 Apr 2014 16:37:34 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;A collection can have an associated &lt;tt&gt;ObjectClass&lt;/tt&gt; and this information is cached, allowing it to be set once and then reused elsewhere in your code.  Once it is set you have to explicitly unset it.&lt;/p&gt;

&lt;p&gt;GridFS is a specification for storing and retrieving files that is built upon the driver. GridFS is opinionated about how it is to be used, as such it sets the &lt;tt&gt;ObjectClass&lt;/tt&gt; for the files collection when you create a GridFS instance.  The reason it throws an error is the &lt;tt&gt;GridFSFile&lt;/tt&gt; is not expected to be used in the way you&apos;ve show as it could represent a partial part of a file and which is why it throws the &quot;can&apos;t load partial GridFSFile file&quot; runtime error.&lt;/p&gt;

&lt;p&gt;As you&apos;ve found out the associated &lt;tt&gt;ObjectClass&lt;/tt&gt; can only unset by resetting the &lt;tt&gt;ObjectClass&lt;/tt&gt; back to null.&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                            <comment id="562770" author="tspindler@gmail.com" created="Fri, 25 Apr 2014 12:44:40 +0000"  >&lt;p&gt;For now I&apos;ll reset the object associated with the collection, quite a hack though:&lt;/p&gt;

&lt;p&gt;        if (Objects.equal(GridFSDBFile.class, coll.getObjectClass())) &lt;/p&gt;
{
            coll.setObjectClass(null);
        }</comment>
                    </comments>
                    <attachments>
                            <attachment id="42124" name="TestDriver.java" size="2072" author="tetet" created="Fri, 25 Apr 2014 11:40:22 +0000"/>
                    </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|hrycbr:</customfieldvalue>

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