<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:39:50 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>[SERVER-16063] Rewrite findAndModify</title>
                <link>https://jira.mongodb.org/browse/SERVER-16063</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;h5&gt;&lt;a name=&quot;Overview&quot;&gt;&lt;/a&gt;Overview&lt;/h5&gt;

&lt;p&gt;The findAndModify command will be re-implemented in terms of getExecutorDelete() and getExecutorUpdate(). If the findAndModify specifies remove, then it will use getExecutorDelete() to retrieve a PlanExecutor wrapping a DeleteStage. If findAndModify specifies update, then it will use getExecutorUpdate() to retrieve a PlanExecutor wrapping an UpdateStage.&lt;/p&gt;

&lt;h5&gt;&lt;a name=&quot;Details&quot;&gt;&lt;/a&gt;Details&lt;/h5&gt;

&lt;p&gt;In order to support findAndModify, the UpdateStage and the DeleteStage will be extended as follows:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;A &lt;tt&gt;returnDeleted&lt;/tt&gt; option will be added to DeleteRequest, with a default of false. Find and modify operations will set this option to true. A delete PlanExecutor with &lt;tt&gt;returnDeleted&lt;/tt&gt; set will return PlanExecutor::ADVANCED and an owned copy of the deleted object every time that it commits a document delete.&lt;/li&gt;
	&lt;li&gt;The option &lt;tt&gt;returnDocs&lt;/tt&gt; will be added to UpdateRequest, replacing the existing &lt;tt&gt;storeResultDoc&lt;/tt&gt; option. It will take one of three values: RETURN_NEW, RETURN_OLD, or RETURN_NONE.&lt;/li&gt;
	&lt;li&gt;If RETURN_NEW, the PlanExecutor will return PlanExecutor::ADVANCED with a owned or unowned copy of each updated document&apos;s post-image. If the update results in an insert, it will return ADVANCED once and return the inserted document.&lt;/li&gt;
	&lt;li&gt;If RETURN_OLD, the PlanExecutor will return PlanExecutor::ADVANCED with an owned copy of each updated document&apos;s pre-image. If the update results in an insert, it will return neither ADVANCED nor will it return a copy of the updated document.&lt;/li&gt;
	&lt;li&gt;If RETURN_NONE, the behavior will remain as is. Namely, the PlanExecutor will never return ADVANCED.&lt;/li&gt;
&lt;/ul&gt;


&lt;h5&gt;&lt;a name=&quot;Explain&quot;&gt;&lt;/a&gt;Explain&lt;/h5&gt;

&lt;p&gt;This change should allow for a sane implementation of CmdFindAndModify::explain(). The explain will return the UPDATE or DELETE plan tree being used to execute the operation.&lt;/p&gt;

&lt;h5&gt;&lt;a name=&quot;Furthernotes&quot;&gt;&lt;/a&gt;Further notes&lt;/h5&gt;

&lt;ul&gt;
	&lt;li&gt;findAndModify will have the same behavior under concurrency as regular updates and deletes. It will take a MODE_IX lock and will use a YIELD_AUTO plan.&lt;/li&gt;
	&lt;li&gt;If &lt;tt&gt;upsert&lt;/tt&gt; is set to true, this will simply be passed through by setting the &lt;tt&gt;upsert&lt;/tt&gt; flag on the UpdateRequest.&lt;/li&gt;
	&lt;li&gt;findAndModify will continue to require its own handling for WriteConflictException retry and for collection creation on upsert into an empty collection.&lt;/li&gt;
	&lt;li&gt;Find and modify will no longer depend on helpers such as deleteObjects() or mongo::update().&lt;/li&gt;
	&lt;li&gt;This will probably involve a rewrite or at least clean up the parsing of the command BSON.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="168391">SERVER-16063</key>
            <summary>Rewrite findAndModify</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="charlie.swanson@mongodb.com">Charlie Swanson</assignee>
                                    <reporter username="rassi">J Rassi</reporter>
                        <labels>
                    </labels>
                <created>Mon, 10 Nov 2014 23:25:50 +0000</created>
                <updated>Tue, 12 Jul 2016 16:38:26 +0000</updated>
                            <resolved>Tue, 14 Apr 2015 14:41:25 +0000</resolved>
                                                    <fixVersion>3.1.2</fixVersion>
                                    <component>Querying</component>
                    <component>Write Ops</component>
                                        <votes>1</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="880721" author="xgen-internal-githook" created="Tue, 14 Apr 2015 14:33:44 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;name&apos;: u&apos;Charlie&apos;, u&apos;email&apos;: u&apos;charlie.swanson@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-16063&quot; title=&quot;Rewrite findAndModify&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-16063&quot;&gt;&lt;del&gt;SERVER-16063&lt;/del&gt;&lt;/a&gt; Rewrite the findAndModify command.&lt;/p&gt;

&lt;p&gt;Changed UpdateStage to return the prior or newly-updated version of&lt;br/&gt;
a document if request. also changed DeleteStage to return the deleted&lt;br/&gt;
document if requested.&lt;/p&gt;

&lt;p&gt;Added explain support to the findAndModify command.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7a36b1598c45ea07a4713d4630fee204ff782e96&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7a36b1598c45ea07a4713d4630fee204ff782e96&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="840932" author="rassi@10gen.com" created="Mon, 2 Mar 2015 22:33:40 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=matt.parlane%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;matt.parlane@gmail.com&quot;&gt;matt.parlane@gmail.com&lt;/a&gt;: nope.  This ticket is a simple refactor of existing functionality, and will include no user-facing changes.&lt;/p&gt;</comment>
                            <comment id="840775" author="matt.parlane@gmail.com" created="Mon, 2 Mar 2015 22:14:41 +0000"  >&lt;p&gt;Is this anything to do with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-11753&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-11753&lt;/a&gt; ? Would be ultra sweet if that could be done as well.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="48160">SERVER-6865</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="272909">SERVER-23171</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="106847">SERVER-12414</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="156169">SERVER-15128</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="168469">SERVER-16071</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="173397">SERVER-16469</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="196053">SERVER-18054</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="225719">SERVER-19957</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="292394">SERVER-24462</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="164286">SERVER-15715</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 9 Dec 2014 02:32:43 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 44 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-112</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 44 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>rassi</customfieldvalue>
            <customfieldvalue>matt.parlane@gmail.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrljdj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrewv3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>147249</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="430">Quint 3.1.0</customfieldvalue>
    <customfieldvalue id="450">Quint Iteration 3.1.1</customfieldvalue>
    <customfieldvalue id="470">Quint Iteration 3.1.2</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsghjr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>