<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:00:08 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-42307] $lookup overwrites the entire object and erases fields (other than what &quot;as&quot; holds) when used inside an array of nested objects</title>
                <link>https://jira.mongodb.org/browse/SERVER-42307</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Schema:&lt;br/&gt;
{&lt;br/&gt;
    x:&lt;/p&gt;
{type: String, required: true}
&lt;p&gt;,&lt;br/&gt;
    a: [{&lt;br/&gt;
        _b: &lt;/p&gt;
{type: Schema.Types.ObjectId, ref: &quot;B&quot;, required: true}
&lt;p&gt;,&lt;br/&gt;
        c: &lt;/p&gt;
{type: Number, required: true}
&lt;p&gt;,&lt;br/&gt;
        _d: &lt;/p&gt;
{type: Schema.Types.ObjectId, ref: &quot;D&quot;, required: true}
&lt;p&gt;,&lt;br/&gt;
        e: {&lt;br/&gt;
            f: &lt;/p&gt;
{type: Number, required: true}
&lt;p&gt;        }&lt;br/&gt;
    }]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;lookup stage:&lt;br/&gt;
{&lt;br/&gt;
    &quot;$lookup&quot;:&lt;/p&gt;
{
        from: &quot;B&quot;,
        localField: &quot;a._b&quot;,
        foreignField: &quot;_id&quot;,
        as: &quot;a._b&quot;
    }
&lt;p&gt;},&lt;br/&gt;
{&lt;br/&gt;
    &quot;$unwind&quot;:&lt;/p&gt;
{
        path: &quot;$a._b&quot;
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;expected result:&lt;br/&gt;
{&lt;br/&gt;
    x:/.../,&lt;br/&gt;
    a:{&lt;br/&gt;
        _b:&lt;span class=&quot;error&quot;&gt;&amp;#91;Object&amp;#93;&lt;/span&gt;,&lt;br/&gt;
        c:/.../,&lt;br/&gt;
        _d:/.../,&lt;br/&gt;
        e:&lt;/p&gt;
{
            f:/.../
        }
&lt;p&gt;    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;result:&lt;br/&gt;
{&lt;br/&gt;
    x:/.../,&lt;br/&gt;
    a: &lt;/p&gt;
{
         _b: [Object]
     }
&lt;p&gt;,&lt;br/&gt;
}&lt;/p&gt;



&lt;p&gt;As you can see above, fields inside the &quot;a&quot; gets overwritten by the $lookup operation.&lt;/p&gt;</description>
                <environment></environment>
        <key id="868899">SERVER-42307</key>
            <summary>$lookup overwrites the entire object and erases fields (other than what &quot;as&quot; holds) when used inside an array of nested objects</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="mertanilhasret@hotmail.com">Mert Hasret</reporter>
                        <labels>
                            <label>Bug</label>
                    </labels>
                <created>Fri, 19 Jul 2019 19:44:05 +0000</created>
                <updated>Fri, 19 Jul 2019 20:36:42 +0000</updated>
                            <resolved>Fri, 19 Jul 2019 20:36:42 +0000</resolved>
                                                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2334838" author="daniel.hatcher" created="Fri, 19 Jul 2019 20:36:42 +0000"  >&lt;p&gt;Closing as duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42306&quot; title=&quot;$lookup with an array of sub objects should allow for an option to allow each sub object to find join partners&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42306&quot;&gt;SERVER-42306&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="868871">SERVER-42306</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>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, 19 Jul 2019 20:36:42 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 29 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>daniel.hatcher@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 29 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>daniel.hatcher@mongodb.com</customfieldvalue>
            <customfieldvalue>mertanilhasret@hotmail.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hvgd5j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hv5et3:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;ul&gt;
	&lt;li&gt;Create a schema as shown in the &quot;Description&quot; section.&#160;&lt;/li&gt;
	&lt;li&gt;Run the query given in the &quot;Description&quot; section on one of the versions listed in &quot;Affects Version/s&quot; section.&lt;/li&gt;
	&lt;li&gt;PS: My assumption is that the given aggregation doesn&apos;t give the expected output past 3.4.5, but I have only listed the version that I have tested the aggregation on.&lt;/li&gt;
&lt;/ul&gt;
</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|hvfzev:</customfieldvalue>

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