<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:58:39 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>[CXX-250] better api on GridFS and GridFile</title>
                <link>https://jira.mongodb.org/browse/CXX-250</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;In &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-249&quot; title=&quot;better remove api on GridFS and GridFile &quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-249&quot;&gt;&lt;del&gt;SERVER-12315&lt;/del&gt;&lt;/a&gt; I proposed an improvement of the &lt;em&gt;remove&lt;/em&gt; api on GridFS.&lt;/p&gt;

&lt;p&gt;In fact others key features are missing from the GridFS &amp;amp; GridFile classes.&lt;br/&gt;
The general idea is to be able to easily do CRUD operations:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Create: current &lt;em&gt;storeFile()&lt;/em&gt; methods only allow to set &lt;em&gt;fileName&lt;/em&gt; and &lt;em&gt;contentType&lt;/em&gt; on the GridFile. According to &lt;a href=&quot;http://docs.mongodb.org/manual/reference/gridfs/#gridfs-files-collection&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;GridFS Reference&lt;/a&gt; there are &lt;em&gt;aliases&lt;/em&gt; and &lt;em&gt;metadata&lt;/em&gt; too. Also, _fileName_should be optional, and it&apos;s not (we can set an empty filename with the buffer api, which is close to &quot;optional&quot;, but not exactly the same; but we cannot even do that with tile file api).&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Read: we need a full featured query api for &quot;find&quot;: currently we have &lt;em&gt;findFile()&lt;/em&gt; &amp;amp; &lt;em&gt;list()&lt;/em&gt;.
	&lt;ul&gt;
		&lt;li&gt;&lt;em&gt;findFile()&lt;/em&gt; should be able to return a list of GridFiles. In fact it would be really useful to have a full-featured queyring api like &lt;em&gt;db.collection.find()&lt;/em&gt;:  query, skip, limit, sort; or maybe just accept a DBClientCursor to avoid duplicating the &lt;em&gt;find()&lt;/em&gt; api.&lt;/li&gt;
		&lt;li&gt;&lt;em&gt;list()&lt;/em&gt; is probably less useful if &lt;em&gt;findFile()&lt;/em&gt; can return multiple GridFiles. If we keep it we could add a full-featured api like proposed &lt;em&gt;findFile()&lt;/em&gt;.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Update: GridFile is currently a read-only view of the db; we could add a method to update the fs.files fields (filename, contentType, aliases, metadata). I&apos;m not sure about modifying the data itself. It would require more work anyway.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Delete: see &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-249&quot; title=&quot;better remove api on GridFS and GridFile &quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-249&quot;&gt;&lt;del&gt;SERVER-12315&lt;/del&gt;&lt;/a&gt;: we need a full featured query api for &quot;remove&quot;, like the &lt;em&gt;find&lt;/em&gt; api: query, skip, limit, sort; or maybe just accept a DBClientCursor.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;A real use-case: multiple files with the same filename, I just want to get a GridFile of the last inserted file given a filename: I cannot use GridFS and GridFile to do that with the current API.&lt;/p&gt;</description>
                <environment></environment>
        <key id="105768">CXX-250</key>
            <summary>better api on GridFS and GridFile</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="trsystran">Thomas Riccardi</reporter>
                        <labels>
                            <label>cxxmove</label>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Mon, 13 Jan 2014 11:57:15 +0000</created>
                <updated>Wed, 21 Jun 2023 14:20:43 +0000</updated>
                            <resolved>Wed, 7 Jan 2015 16:45:38 +0000</resolved>
                                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="799128" author="adam.midvidy" created="Wed, 7 Jan 2015 16:45:38 +0000"  >&lt;p&gt;At this time we do not plan to make significant changes to the API of the legacy driver.&lt;/p&gt;</comment>
                            <comment id="480968" author="trsystran" created="Mon, 13 Jan 2014 15:35:37 +0000"  >&lt;p&gt;We currently have no way to construct a GridFile from a cursor or a BSONObj, although it&apos;s what&apos;s done in private. It would thus be great to have a public or at least protected constructor for GridFile, instead of private.&lt;/p&gt;</comment>
                            <comment id="480950" author="trsystran" created="Mon, 13 Jan 2014 15:08:17 +0000"  >&lt;p&gt;For the full api like &lt;em&gt;find()&lt;/em&gt; there are also the read preferences, see &lt;a href=&quot;https://bitbucket.org/onyxmaster/mod_gridfs/src/f7d5e545e0cf0f84afe9597827a95e143e31e695/patches/gridfs?at=v0.3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this patch&lt;/a&gt;; which adds an optional &lt;em&gt;readPrefMode&lt;/em&gt; paramater to many methods; and also optionally disables the ensureIndex (this performance patch is the only thing needed to dynamically create GridFS objects from parsing a URI for example).&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|hrwm3b:</customfieldvalue>

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