<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51:52 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-261] GridFSInputFile.getMetaData() returns wrong value</title>
                <link>https://jira.mongodb.org/browse/JAVA-261</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;When saving a new file, GridFSInputFile overrides getMetadata() to return _metadata instead of _metadata.get(&quot;metadata&quot;).  As a result, metadata values are saved directly in the files object, not in a field named &quot;metadata&quot; as indicated in the spec.  For example, we end up with:&lt;/p&gt;

{ &quot;_id&quot; : ObjectId(...), &quot;chunkSize&quot; : ..., &quot;length&quot; : ...,  &quot;myMetadataField&quot; : &quot;myValue&quot; }

&lt;p&gt;instead of:&lt;/p&gt;

&lt;p&gt;{ &quot;_id&quot; : ObjectId(...), &quot;chunkSize&quot; : ..., &quot;length&quot; : ...,  metadata : &lt;/p&gt;
{ &quot;myMetadataField&quot; : &quot;myValue&quot; }
&lt;p&gt; }&lt;/p&gt;

&lt;p&gt;I would think GridFSInputFile should not override getMetadata() at all, but instead GridFSFile should either provide a setMetadata(DBObject) method or getMetadata() should create an object to return and simply not save it to the database if it&apos;s empty.  I can currently work around this bug by creating a new BasicDBObject and calling myGridFSInputFile.put(&quot;metadata&quot;, myBasicDBObject), but in my opinion I shouldn&apos;t need to know about the specific implementation of DBObject in use, or the fact that metadata is stored as a field named &quot;metadata&quot;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="14308">JAVA-261</key>
            <summary>GridFSInputFile.getMetaData() returns wrong value</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="antoine">Antoine Girbal</assignee>
                                    <reporter username="fluffy">Ryan Krebs</reporter>
                        <labels>
                    </labels>
                <created>Tue, 25 Jan 2011 21:01:52 +0000</created>
                <updated>Wed, 14 May 2014 19:04:50 +0000</updated>
                            <resolved>Thu, 10 Feb 2011 18:23:33 +0000</resolved>
                                    <version>2.4</version>
                                    <fixVersion>2.5</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="24700" author="brendan" created="Fri, 25 Feb 2011 20:35:31 +0000"  >&lt;p&gt;If you were using metadata previously in GridFS with previous versions (&amp;lt;= 2.4) then you will have breakage of your files... MetaData will be nested in a metadata key on the object.&lt;/p&gt;</comment>
                            <comment id="23587" author="auto" created="Thu, 10 Feb 2011 18:25:27 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-261&quot; title=&quot;GridFSInputFile.getMetaData() returns wrong value&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-261&quot;&gt;&lt;del&gt;JAVA-261&lt;/del&gt;&lt;/a&gt;: GridFSInputFile.getMetaData() returns wrong value&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/cf8b36786a65e1c13447ba2bec67804e597f10da&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/cf8b36786a65e1c13447ba2bec67804e597f10da&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="23586" author="antoine" created="Thu, 10 Feb 2011 18:23:33 +0000"  >&lt;p&gt;this is resolved:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;remove overload of getMetadata in gridfsinputfile&lt;/li&gt;
	&lt;li&gt;in gridfsfile, renamed metadata to extradata to remove confusion&lt;/li&gt;
	&lt;li&gt;in gridfsfile, methods to get/set metadata.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Uploaded file now looks like:&lt;br/&gt;
{ &quot;_id&quot; : &lt;/p&gt;
{ &quot;$oid&quot; : &quot;4d542ae8cda7d20c1499e49b&quot;}
&lt;p&gt; , &quot;chunkSize&quot; : 262144 , &quot;length&quot; : 1945007 , &quot;md5&quot; : &quot;eeca506d5a94370adc991d717992ecc5&quot; , &quot;filename&quot; : &quot;myimg&quot; , &quot;contentType&quot; : &quot;jpeg&quot; , &quot;uploadDate&quot; : &lt;/p&gt;
{ &quot;$date&quot; : &quot;2011-02-10T18:14:00Z&quot;}
&lt;p&gt; , &quot;aliases&quot; :  null  , &quot;metadata&quot; : { &quot;a&quot; : 1}}&lt;/p&gt;

&lt;p&gt;Note metadata must be passes as a dbobject, cannot be a string.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <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|hrgiv3:</customfieldvalue>

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