<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56: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-1198] BSONObjBuilder.merge( BSONObj o ) - add fields not already there</title>
                <link>https://jira.mongodb.org/browse/SERVER-1198</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If we have some BSONObj with similar structure and we append them using the same BSONObjBuilder, the resulting BSONObjectBuilder.obj() is malformed...&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;BSONObj o&lt;span class=&quot;error&quot;&gt;&amp;#91;5&amp;#93;&lt;/span&gt; =&lt;br/&gt;
        &lt;/p&gt;
{
            BSON(&quot;subobj&quot; &amp;lt;&amp;lt; BSON(&quot;text&quot; &amp;lt;&amp;lt; &quot;old-text-val&quot;)),
            BSON(&quot;subobj&quot; &amp;lt;&amp;lt; BSON(&quot;field&quot; &amp;lt;&amp;lt; &quot;other-field-val&quot;)),
            BSON(&quot;subobj&quot; &amp;lt;&amp;lt; BSON(&quot;text&quot; &amp;lt;&amp;lt; &quot;new-text-val&quot;)),
            BSON(&quot;simple&quot; &amp;lt;&amp;lt; 3),
            BSON(&quot;other&quot; &amp;lt;&amp;lt; 4)
        }
&lt;p&gt;;&lt;/p&gt;

&lt;p&gt;        BSONObjBuilder b;&lt;br/&gt;
        for (unsigned int i=0; i&amp;lt;5; ++i) b.appendElements(o&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt;);&lt;/p&gt;

&lt;p&gt;Resulting object from builder have three different &apos;subobj&apos; fields. And if you insert this obj in database these three fields become identical (and repeated).&lt;/p&gt;

&lt;p&gt;It would be useful if BSONObjBuilder could merge objects overwriting similar fields, so the previous code will gives an object like this:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
     &quot;subobj&quot; : &lt;/p&gt;
{&quot;text&quot; : &quot;new-text-val&quot;, &quot;field&quot; : &quot;other-field-val&quot;}
&lt;p&gt;,&lt;br/&gt;
     &quot;simple&quot; : 3,&lt;br/&gt;
     &quot;other&quot; : 4&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;and not like this one (current behaviour):&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
     &quot;subobj&quot; : &lt;/p&gt;
{&quot;text&quot; : &quot;old-text-val&quot;}
&lt;p&gt;,&lt;br/&gt;
     &quot;subobj&quot; : &lt;/p&gt;
{&quot;field&quot; : &quot;other-field-val&quot;}
&lt;p&gt;,&lt;br/&gt;
     &quot;subobj&quot; : &lt;/p&gt;
{&quot;text&quot; : &quot;new-text-val&quot;}
&lt;p&gt;,&lt;br/&gt;
     &quot;simple&quot; : 3,&lt;br/&gt;
     &quot;other&quot; : 4&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;if you insert this object in db, and then you retrieve it, you&apos;ll read:&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
     &quot;subobj&quot; : &lt;/p&gt;
{&quot;text&quot; : &quot;old-text-val&quot;}
&lt;p&gt;,&lt;br/&gt;
     &quot;subobj&quot; : &lt;/p&gt;
{&quot;text&quot; : &quot;old-text-val&quot;}
&lt;p&gt;,&lt;br/&gt;
     &quot;subobj&quot; : &lt;/p&gt;
{&quot;text&quot; : &quot;old-text-val&quot;}
&lt;p&gt;,&lt;br/&gt;
     &quot;simple&quot; : 3,&lt;br/&gt;
     &quot;other&quot; : 4&lt;br/&gt;
}&lt;/p&gt;
</description>
                <environment></environment>
        <key id="12086">SERVER-1198</key>
            <summary>BSONObjBuilder.merge( BSONObj o ) - add fields not already there</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="4">Incomplete</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="trikko">Andrea Fontana</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Jun 2010 03:47:21 +0000</created>
                <updated>Fri, 24 Feb 2017 15:44:28 +0000</updated>
                            <resolved>Fri, 24 Feb 2017 15:44:27 +0000</resolved>
                                    <version>1.5.2</version>
                                                    <component>Internal Client</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1508789" author="milkie" created="Fri, 24 Feb 2017 15:44:28 +0000"  >&lt;p&gt;The legacy C++ driver is no longer in active development.&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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 24 Feb 2017 15:44:28 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 50 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>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>milkie@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 50 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>trikko</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrplr3:</customfieldvalue>

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

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

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