<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:01:31 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-1136] collection::find_one_and_* should return result::find_one_and_* objects</title>
                <link>https://jira.mongodb.org/browse/CXX-1136</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;The return type of the collection::find_one_and_*() methods is currently stdx::optional&amp;lt;bsoncxx::document::value&amp;gt;.  These methods return a disengaged optional if the &quot;value&quot; field from the findAndModify command response is null; otherwise, they return the document that was returned in &quot;value&quot;.&lt;/p&gt;

&lt;p&gt;Instead, collection::find_one_and_&amp;#42;() should result objects (i.e. result::find_one_and_&amp;#42;), like the rest of the write methods do.  This would be preferable for the following reasons:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Consistency with the rest of the write methods.&lt;/li&gt;
	&lt;li&gt;In the case of an upsert operation, the _id of the inserted document could be exposed.  Currently, if a k_before find_one_and_update with an upsert is issued and the operation results in an insert, the user does not have access to the _id of the inserted document.&lt;/li&gt;
	&lt;li&gt;The result object could include a manufactured result::bulk_write object.  This would allow clients to re-use code to process the result of these operations that was already written to process the result of other write operations.&lt;/li&gt;
	&lt;li&gt;If the server adds any new useful information to the findAndModify command response in the future, this information could be added to the return value without changing the return type of these API methods.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="332821">CXX-1136</key>
            <summary>collection::find_one_and_* should return result::find_one_and_* objects</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rassi">J Rassi</reporter>
                        <labels>
                            <label>bgtrack</label>
                    </labels>
                <created>Fri, 18 Nov 2016 12:36:07 +0000</created>
                <updated>Wed, 18 Jan 2023 19:44:09 +0000</updated>
                            <resolved>Wed, 18 Jan 2023 19:44:09 +0000</resolved>
                                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5121832" author="JIRAUSER1269924" created="Wed, 18 Jan 2023 19:44:09 +0000"  >&lt;p&gt;After careful evaluation, we have decided to close this ticket. Please add a comment if the impact of this ticket increases.&lt;br/&gt;
Thanks.&lt;/p&gt;</comment>
                            <comment id="1437639" author="david.golden" created="Fri, 18 Nov 2016 15:41:53 +0000"  >&lt;p&gt;Unfortunately, your proposal is not consistent with the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#find-and-modify&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CRUD spec for Find And Modify&lt;/a&gt;, which specifies document or null as the return type for those methods (which we model as optional document).  Since this change would require a change in the CRUD spec, I suggest opening a SPEC ticket and blocking this ticket on the resolution of that.&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|hxk83z:</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>