<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:55:19 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>[DOCS-7935] db.collection.update discrepancy with upsert</title>
                <link>https://jira.mongodb.org/browse/DOCS-7935</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://docs.mongodb.com/manual/reference/method/db.collection.update/#behavior&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/method/db.collection.update/#behavior&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It appears that &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;db.collection.update({_id:null}, {field&quot;test&quot;}, {upsert:true})&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;&lt;em&gt;&lt;b&gt;might&lt;/b&gt;&lt;/em&gt; be implicitly rewritten as&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;db.collection.update({_id:null}, {$set: {field&quot;test&quot;}}, {upsert:true})&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;resulting in unexpected behavior.&lt;/p&gt;

&lt;p&gt;This is probably worth testing in an older version (is the behavior consistent in 2.6.1?).&lt;/p&gt;</description>
                <environment></environment>
        <key id="288409">DOCS-7935</key>
            <summary>db.collection.update discrepancy with upsert</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="jonathan.destefano@mongodb.com">Jonathan DeStefano</assignee>
                                    <reporter username="kevin.arhelger@mongodb.com">Kevin Arhelger</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 May 2016 17:59:15 +0000</created>
                <updated>Wed, 11 Jan 2017 21:46:29 +0000</updated>
                            <resolved>Thu, 7 Jul 2016 17:59:11 +0000</resolved>
                                                    <fixVersion>01112017-cleanup</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1317146" author="xgen-internal-githook" created="Thu, 7 Jul 2016 18:10:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jdestefano-mongo&apos;, u&apos;name&apos;: u&apos;jonathan&apos;, u&apos;email&apos;: u&apos;jonathan.destefano@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Added upsert caveat that if querying on a specific value for _id without update operators and the upsert occurs, the _id will be added as part of the new document. -JD&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Changed language for db.collection.update.  Added that update() and findAndModify() handle upserts similarly.  Updated parameter files to reflect upsert findings.  Removed incorrect statements for findOneAndReplace(). - JD&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Fixed incorrectly named parameter.&lt;/p&gt;

&lt;p&gt;Signed-off-by: kay &amp;lt;kay.kim@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/c3aebcf43793034d4a6ba76ff65a40a79dcb9996&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/c3aebcf43793034d4a6ba76ff65a40a79dcb9996&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1317145" author="xgen-internal-githook" created="Thu, 7 Jul 2016 18:10:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jdestefano-mongo&apos;, u&apos;name&apos;: u&apos;jonathan&apos;, u&apos;email&apos;: u&apos;jonathan.destefano@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Added upsert caveat that if querying on a specific value for _id without update operators and the upsert occurs, the _id will be added as part of the new document. -JD&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Changed language for db.collection.update.  Added that update() and findAndModify() handle upserts similarly.  Updated parameter files to reflect upsert findings.  Removed incorrect statements for findOneAndReplace(). - JD&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Fixed incorrectly named parameter.&lt;/p&gt;

&lt;p&gt;Signed-off-by: kay &amp;lt;kay.kim@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/c3aebcf43793034d4a6ba76ff65a40a79dcb9996&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/c3aebcf43793034d4a6ba76ff65a40a79dcb9996&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1317144" author="xgen-internal-githook" created="Thu, 7 Jul 2016 18:10:56 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jdestefano-mongo&apos;, u&apos;name&apos;: u&apos;jonathan&apos;, u&apos;email&apos;: u&apos;jonathan.destefano@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Added upsert caveat that if querying on a specific value for _id without update operators and the upsert occurs, the _id will be added as part of the new document. -JD&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Changed language for db.collection.update.  Added that update() and findAndModify() handle upserts similarly.  Updated parameter files to reflect upsert findings.  Removed incorrect statements for findOneAndReplace(). - JD&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7935&quot; title=&quot;db.collection.update discrepancy with upsert&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7935&quot;&gt;&lt;del&gt;DOCS-7935&lt;/del&gt;&lt;/a&gt; Fixed incorrectly named parameter.&lt;/p&gt;

&lt;p&gt;Signed-off-by: kay &amp;lt;kay.kim@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/c3aebcf43793034d4a6ba76ff65a40a79dcb9996&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/c3aebcf43793034d4a6ba76ff65a40a79dcb9996&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1298512" author="jonathan.destefano" created="Fri, 17 Jun 2016 21:01:17 +0000"  >&lt;p&gt;It turns out that if the &lt;b&gt;update&lt;/b&gt; parameter contains only field and value pairs those will be set.  In addition, if the &lt;b&gt;query&lt;/b&gt; parameter contains a specific value for the &quot;_id&quot; field, the &quot;_id&quot; field will be set in the new document, but any remaining &lt;b&gt;query&lt;/b&gt; field and value pairs will be discarded.&lt;/p&gt;

&lt;p&gt;Verified in 2.6.1 and 3.2.7&lt;/p&gt;</comment>
                            <comment id="1298343" author="jonathan.destefano" created="Fri, 17 Jun 2016 19:20:45 +0000"  >&lt;p&gt;Verified Abdul&apos;s comment, &amp;lt;update&amp;gt; and &amp;lt;query&amp;gt; parameters are used whether and update operator is used or not.  Will work on testing in 2.6.1 as suggested.&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_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 23 May 2016 11:05:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 31 weeks, 6 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>jess.mokrzecki@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 31 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jonathan.destefano@mongodb.com</customfieldvalue>
            <customfieldvalue>kevin.arhelger@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmrov:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hslodz:</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_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrz6qn:</customfieldvalue>

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