<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:32:21 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-33121] Add updated/deleted _id&apos;s to response object of updateMany and deleteMany</title>
                <link>https://jira.mongodb.org/browse/SERVER-33121</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When running the following code (in Node.js): &lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;collection.updateMany({type: &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;},{&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;$set&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;:{b: &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}}, cb)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;the response object does not show me which records have been updated.&lt;br/&gt;
It only tells me the matchedCount and modifiedCount.&lt;/p&gt;

&lt;p&gt;Could you please add an array named something like:  &quot;modifiedIds&quot; containing all _id&apos;s of the records that have been updated.&lt;br/&gt;
This way you do not require two seperate calls to mongodb to update multiple records and get their _id&apos;s.&lt;/p&gt;


&lt;p&gt;Please also see my stackoverflow question for aditional information and the example.&lt;br/&gt;
&lt;a href=&quot;https://stackoverflow.com/questions/43743931/is-it-possible-to-get-all-the-ids-of-updated-records-in-mongodb-using-updatema&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://stackoverflow.com/questions/43743931/is-it-possible-to-get-all-the-ids-of-updated-records-in-mongodb-using-updatema&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="492421">SERVER-33121</key>
            <summary>Add updated/deleted _id&apos;s to response object of updateMany and deleteMany</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="3">Duplicate</resolution>
                                        <assignee username="david.storch@mongodb.com">David Storch</assignee>
                                    <reporter username="dexter.esajas">Dexter Esajas</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Feb 2018 13:57:12 +0000</created>
                <updated>Fri, 9 Feb 2018 16:32:47 +0000</updated>
                            <resolved>Fri, 9 Feb 2018 16:12:07 +0000</resolved>
                                    <version>3.6.0</version>
                    <version>3.6.1</version>
                    <version>3.6.2</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1800926" author="dexter.esajas" created="Fri, 9 Feb 2018 16:32:47 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for your response, this is indeed what I am looking for!&lt;br/&gt;
Already upvoted and watching!&lt;/p&gt;</comment>
                            <comment id="1800885" author="david.storch" created="Fri, 9 Feb 2018 16:11:55 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dexter.esajas&quot; class=&quot;user-hover&quot; rel=&quot;dexter.esajas&quot;&gt;dexter.esajas&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;I think this should be treated as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-714&quot; title=&quot;Allow findandmodify to retreive more than 1 record at a time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-714&quot;&gt;SERVER-714&lt;/a&gt;. As Andy mentioned above, it would be nice to allow multi-updates and multi-deletes to return a cursor containing the stream of modified documents. Users should be able to supply a projection which would allow you to project out everything other than the &lt;tt&gt;_id&lt;/tt&gt; field, which would satisfy the particulars of your request.&lt;/p&gt;

&lt;p&gt;Note that the server already supports &lt;a href=&quot;https://docs.mongodb.com/manual/reference/command/findAndModify/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;findAndModify&lt;/a&gt;, which allows users to perform a single-update or single-delete and return a copy of the modified document with a projection applied. Extending &lt;tt&gt;findAndModify&lt;/tt&gt;&apos;s functionality to work for multi-document writes is what you need.&lt;/p&gt;

&lt;p&gt;I&apos;m closing this as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-714&quot; title=&quot;Allow findandmodify to retreive more than 1 record at a time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-714&quot;&gt;SERVER-714&lt;/a&gt;. Please watch and vote for that ticket, and feel free to reach out with any questions or concerns.&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
Dave&lt;/p&gt;</comment>
                            <comment id="1800671" author="dexter.esajas" created="Fri, 9 Feb 2018 14:07:09 +0000"  >&lt;p&gt;It seems related in the way that more info could be returned after an operation has been performed I think.&lt;br/&gt;
Do I need to clarify my request with more examples or a better description?&lt;br/&gt;
The reason I am asking is because I&apos;d like this ticket not to be open for roughly 3 years, like ticket &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12858&quot; title=&quot;Return detailed stats from write commands&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12858&quot;&gt;SERVER-12858&lt;/a&gt; &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
I can understand there are more important items on the list though.&lt;/p&gt;</comment>
                            <comment id="1799081" author="asya" created="Thu, 8 Feb 2018 05:52:29 +0000"  >&lt;p&gt;Something like &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12858&quot; title=&quot;Return detailed stats from write commands&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12858&quot;&gt;SERVER-12858&lt;/a&gt; maybe?&lt;/p&gt;</comment>
                            <comment id="1798575" author="schwerin" created="Wed, 7 Feb 2018 20:11:03 +0000"  >&lt;p&gt;I haven&apos;t thought about this a lot, but occasionally it comes up that users would like to get back a cursor that returns the updated or deleted documents modified by their operations. I can&apos;t recall if there are open tickets about that, but perhaps &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt; or &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=asya&quot; class=&quot;user-hover&quot; rel=&quot;asya&quot;&gt;asya&lt;/a&gt; know.&lt;/p&gt;</comment>
                            <comment id="1796394" author="dexter.esajas" created="Tue, 6 Feb 2018 09:38:10 +0000"  >&lt;p&gt;@Andy Schwerin,&lt;br/&gt;
Yes good point!&lt;/p&gt;

&lt;p&gt;What do you guys think about this functionality/feature?&lt;br/&gt;
Do you see the advantage of it as well or do you feel it is unnecessary?&lt;/p&gt;</comment>
                            <comment id="1795595" author="schwerin" created="Mon, 5 Feb 2018 19:22:44 +0000"  >&lt;p&gt;You&apos;d probably want to return a cursor of some sort, in case enough docs are modified to overflow a bson array.&lt;/p&gt;</comment>
                            <comment id="1795176" author="dexter.esajas" created="Mon, 5 Feb 2018 15:34:40 +0000"  >&lt;p&gt;Hi @Ramon Fernandez,&lt;/p&gt;

&lt;p&gt;Thank you for your quick response!&lt;/p&gt;

&lt;p&gt;I&apos;ve missed that it may create a quite some overhead if a user does not require the _id&apos;s to be returned.&lt;br/&gt;
Maybe make returning the _id&apos;s optional through the options of the request like &quot;upsert: true, returnIds: true&quot;.&lt;/p&gt;</comment>
                            <comment id="1795121" author="ramon.fernandez" created="Mon, 5 Feb 2018 15:13:28 +0000"  >&lt;p&gt;Thanks for your report &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dexter.esajas&quot; class=&quot;user-hover&quot; rel=&quot;dexter.esajas&quot;&gt;dexter.esajas&lt;/a&gt;; I&apos;ve tweaked the summary to reflect the improvement nature of this request, and I&apos;m sending this to the Query team for consideration.&lt;/p&gt;</comment>
                            <comment id="1795019" author="dexter.esajas" created="Mon, 5 Feb 2018 14:04:46 +0000"  >&lt;p&gt;So this applies for both updateMany and deleteMany.&lt;br/&gt;
Thank you for your time!&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="11451">SERVER-714</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="98665">SERVER-11753</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="113774">SERVER-12858</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 5 Feb 2018 15:13:28 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 5 days 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_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>dexter.esajas</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>dexter.esajas</customfieldvalue>
            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htpll3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hth49z:</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>
                                                                                            <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="2117">Query 2018-02-12</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|htp7pr:</customfieldvalue>

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