<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:58:38 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-1988] Upsert allows inserting records with dots in key names</title>
                <link>https://jira.mongodb.org/browse/SERVER-1988</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Insert does not allow inserting records with fields containing keys with dots in them, which as I understand it is the correct behaviour. An upsert however, will perfectly happily do this:&lt;/p&gt;

&lt;p&gt;&amp;gt; db.test.insert(&lt;/p&gt;
{ &quot;test&quot;: 1, &quot;te.st&quot;: 1 }
&lt;p&gt;); &lt;br/&gt;
Fri Oct 22 17:13:37 uncaught exception: can&apos;t have . in field names &lt;span class=&quot;error&quot;&gt;&amp;#91;te.st&amp;#93;&lt;/span&gt;&lt;br/&gt;
&amp;gt; db.test.update(&lt;/p&gt;
{ &quot;test&quot;: 1 }
&lt;p&gt;, &lt;/p&gt;
{ &quot;test&quot;: 1, &quot;te.st&quot;: 1 }
&lt;p&gt;, 1); &lt;br/&gt;
&amp;gt; db.test.find()&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4cc1b8371c20e0349d6568ad&quot;), &quot;test&quot; : 1, &quot;te.st&quot; : 1 }</description>
                <environment>linux 32 bit</environment>
        <key id="13462">SERVER-1988</key>
            <summary>Upsert allows inserting records with dots in key names</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="antoine">Antoine Girbal</assignee>
                                    <reporter username="abayliss">Andrew Bayliss</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Oct 2010 16:24:12 +0000</created>
                <updated>Tue, 12 Jul 2016 00:20:37 +0000</updated>
                            <resolved>Fri, 17 Dec 2010 08:22:09 +0000</resolved>
                                    <version>1.6.2</version>
                                    <fixVersion>1.7.4</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="21535" author="auto" created="Fri, 17 Dec 2010 18:56:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1988&quot; title=&quot;Upsert allows inserting records with dots in key names&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1988&quot;&gt;&lt;del&gt;SERVER-1988&lt;/del&gt;&lt;/a&gt;: added unit test&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4f10562afc2e8aed5b978ed858c223325c45e907&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4f10562afc2e8aed5b978ed858c223325c45e907&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="21518" author="antoine" created="Fri, 17 Dec 2010 08:21:54 +0000"  >&lt;p&gt;did following tests on patch&lt;/p&gt;

&lt;p&gt;&amp;gt; db.dot.insert(&lt;/p&gt;
{&quot;a&quot;: 0,&quot;b&quot;: 1}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.dot.insert(&lt;/p&gt;
{&quot;a&quot;: 0,&quot;b.b&quot;: 1}
&lt;p&gt;)&lt;br/&gt;
Thu Dec 16 23:07:33 uncaught exception: can&apos;t have . in field names &lt;span class=&quot;error&quot;&gt;&amp;#91;b.b&amp;#93;&lt;/span&gt;&lt;br/&gt;
&amp;gt; db.dot.update(&lt;/p&gt;
{&quot;a&quot;: 0}
&lt;p&gt;, &lt;/p&gt;
{&quot;b.b&quot;: 1}
&lt;p&gt;)&lt;br/&gt;
Thu Dec 16 23:07:58 uncaught exception: can&apos;t have . in field names &lt;span class=&quot;error&quot;&gt;&amp;#91;b.b&amp;#93;&lt;/span&gt;&lt;br/&gt;
&amp;gt; db.dot.findOne()&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4d0b0c592bc8d37d2a1dfd78&quot;), &quot;a&quot; : 0, &quot;b&quot; : 1 }
&lt;p&gt;&amp;gt; db.dot.update(&lt;/p&gt;
{&quot;a&quot;: 0}
&lt;p&gt;, {$set: { &quot;c.c&quot;: 1}})&lt;br/&gt;
&amp;gt; db.dot.findOne()&lt;br/&gt;
{&lt;br/&gt;
	&quot;_id&quot; : ObjectId(&quot;4d0b0c592bc8d37d2a1dfd78&quot;),&lt;br/&gt;
	&quot;a&quot; : 0,&lt;br/&gt;
	&quot;b&quot; : 1,&lt;br/&gt;
	&quot;c&quot; : &lt;/p&gt;
{
		&quot;c&quot; : 1
	}
&lt;p&gt;}&lt;br/&gt;
&amp;gt; db.dot.update(&lt;/p&gt;
{&quot;a&quot;: 0}
&lt;p&gt;, {&quot;&quot;: { &quot;c.c&quot;: 1}})&lt;br/&gt;
Fri Dec 17 00:10:19 uncaught exception: can&apos;t have . in field names &lt;span class=&quot;error&quot;&gt;&amp;#91;c.c&amp;#93;&lt;/span&gt;&lt;br/&gt;
&amp;gt; db.dot.update(&lt;/p&gt;
{&quot;a&quot;: 0}
&lt;p&gt;, {})&lt;br/&gt;
&amp;gt; db.dot.findOne()&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4d0b0c592bc8d37d2a1dfd78&quot;) }</comment>
                            <comment id="21517" author="auto" created="Fri, 17 Dec 2010 08:13:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1988&quot; title=&quot;Upsert allows inserting records with dots in key names&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1988&quot;&gt;&lt;del&gt;SERVER-1988&lt;/del&gt;&lt;/a&gt;: Upsert allows inserting records with dots in key names&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/28904fa7ae991355a1043da387328ad98bb0ac84&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/28904fa7ae991355a1043da387328ad98bb0ac84&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="21494" author="eliot" created="Fri, 17 Dec 2010 02:16:05 +0000"  >&lt;p&gt;That sounds right.&lt;/p&gt;</comment>
                            <comment id="21492" author="antoine" created="Fri, 17 Dec 2010 01:36:50 +0000"  >&lt;p&gt;Ok so as agreed, the fix goes into the shell, not db since it does not inspect full obj.&lt;br/&gt;
But &quot;.&quot; is actually allowed in field names in case an object is modified (instead of overwritten).&lt;br/&gt;
So the fix would be:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;if 1st field name of update starts with &quot;$&quot;, do not check&lt;/li&gt;
	&lt;li&gt;otherwise apply same validation as insert&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="21403" author="eliot" created="Tue, 14 Dec 2010 00:25:57 +0000"  >&lt;p&gt;We only have to inspect the update spec, not the resulting object.&lt;br/&gt;
The update spec is going to be small even if the resulting object is huge.&lt;/p&gt;

&lt;p&gt;Can probably rename and reuse checkNoMods, but its been a while &lt;/p&gt;</comment>
                            <comment id="21401" author="antoine" created="Mon, 13 Dec 2010 23:32:31 +0000"  >&lt;p&gt;it looks to me that we do not run a complete parse of the update object at any point of the processing.&lt;br/&gt;
For both insert and update, the db pretty much takes the object as is.&lt;br/&gt;
If we want to catch this we have to traverse the object to check all the keys.&lt;/p&gt;</comment>
                            <comment id="21393" author="eliot" created="Mon, 13 Dec 2010 20:26:50 +0000"  >&lt;p&gt;For update it does have some protection in update.cpp&lt;br/&gt;
we should enhance update there&lt;/p&gt;</comment>
                            <comment id="21391" author="antoine" created="Mon, 13 Dec 2010 20:03:48 +0000"  >&lt;p&gt;basically mongodb does not reject key names with &quot;.&quot;, it&apos;s at the driver&apos;s discretion.&lt;br/&gt;
we can fix the shell to check for it, but ultimately shouldnt mongodb have its own protection against it?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 13 Dec 2010 20:03:48 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 9 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>abayliss</customfieldvalue>
            <customfieldvalue>antoine</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpco7:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21350</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_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|ht0euv:</customfieldvalue>

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