<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:58:48 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-21913] Allow $lookup to join on multiple keys</title>
                <link>https://jira.mongodb.org/browse/SERVER-21913</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The Aggregation Framework $lookup stage currently only allows single key foreign key equality lookups in a joined collection.  This does not allow opportunities where the uniqueness of a joined collection requires multiple keys in the joined collection.&lt;/p&gt;

&lt;p&gt;One of the earlier syntaxes for $lookup had the following subdocument, which is consistent with find syntax, and would naturally allow multiple key joins:&lt;/p&gt;

&lt;p&gt;on : &lt;/p&gt;
{ sourceKey1 : $foreignKey1 }

&lt;p&gt;or for multiple keys:&lt;/p&gt;

&lt;p&gt;on : &lt;/p&gt;
{ sourceKey1 : $foreignKey1, sourceKey2 : $foreignKey2 }
</description>
                <environment></environment>
        <key id="244045">SERVER-21913</key>
            <summary>Allow $lookup to join on multiple keys</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="backlog-server-query">Backlog - Query Team</assignee>
                                    <reporter username="lparayno">Lee Parayno</reporter>
                        <labels>
                            <label>eng-m</label>
                            <label>expression</label>
                    </labels>
                <created>Tue, 15 Dec 2015 19:34:08 +0000</created>
                <updated>Thu, 6 Apr 2023 21:24:37 +0000</updated>
                            <resolved>Thu, 23 Nov 2017 21:41:08 +0000</resolved>
                                    <version>3.2.0</version>
                                                    <component>Aggregation Framework</component>
                                        <votes>13</votes>
                                    <watches>23</watches>
                                                                                                                <comments>
                            <comment id="1735852" author="cade@hyperblaster.org" created="Tue, 28 Nov 2017 11:32:36 +0000"  >&lt;p&gt;Thanks James. Legendary!&lt;/p&gt;</comment>
                            <comment id="1735098" author="james.wahlin@10gen.com" created="Mon, 27 Nov 2017 16:54:39 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=cadeembery&quot; class=&quot;user-hover&quot; rel=&quot;cadeembery&quot;&gt;cadeembery&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;This feature is currently available for testing under the &lt;a href=&quot;https://www.mongodb.com/download-center#development&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;latest MongoDB 3.6 release candidate&lt;/a&gt;. It will be available for production use in MongoDB 3.6.0 once released. &lt;/p&gt;

&lt;p&gt;For more information, please see our documentation for $lookup using pipeline syntax:&lt;br/&gt;
&lt;a href=&quot;https://docs.mongodb.com/master/reference/operator/aggregation/lookup/index.html#join-conditions-and-uncorrelated-sub-queries&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/master/reference/operator/aggregation/lookup/index.html#join-conditions-and-uncorrelated-sub-queries&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
James&lt;/p&gt;</comment>
                            <comment id="1734007" author="cade@hyperblaster.org" created="Fri, 24 Nov 2017 08:37:56 +0000"  >&lt;p&gt;So is this available now? Or in a future release? I am really trying to contain my excitement for the possibility of $lookup $match criteria&lt;/p&gt;</comment>
                            <comment id="1733863" author="asya" created="Thu, 23 Nov 2017 21:41:08 +0000"  >&lt;p&gt;Resolved by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-29072&quot; title=&quot;Add support for $lookup into a sub-pipeline&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-29072&quot;&gt;&lt;del&gt;SERVER-29072&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1608068" author="lparayno" created="Tue, 27 Jun 2017 20:56:05 +0000"  >&lt;p&gt;Asya, that&apos;s great news.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="1605915" author="asya" created="Sun, 25 Jun 2017 04:05:34 +0000"  >&lt;p&gt;As announced at MongoDB World, this will be handled by more expressive $lookup currently tracked under &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-29072&quot; title=&quot;Add support for $lookup into a sub-pipeline&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-29072&quot;&gt;&lt;del&gt;SERVER-29072&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1292769" author="alice@gothcandy.com" created="Mon, 13 Jun 2016 20:42:53 +0000"  >&lt;p&gt;There is a more general solution to this: extend the &lt;tt&gt;$lookup&lt;/tt&gt; stage to make use of &lt;tt&gt;$match&lt;/tt&gt; and &lt;tt&gt;$project&lt;/tt&gt; sub-stages.  Allowing a match document would resolve this issue and simplify away the special-casing of localField(s) / foreignField(s):&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;   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;{$lookup: {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;    from: &quot;Invoices&quot;,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;    match: {&quot;_id&quot;: &quot;$invoice&quot;},&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;    project: {&quot;state&quot;: 1},&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;    as: &quot;invoices&quot;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;}}&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 pseudo-&lt;tt&gt;match&lt;/tt&gt; would map keys from the foreign side to expressions evaluated within the context of the &quot;parent&quot; document.  (This would also help resolve &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22188&quot; title=&quot;allow $lookup condition that&amp;#39;s not equality&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22188&quot;&gt;&lt;del&gt;SERVER-22188&lt;/del&gt;&lt;/a&gt;, too.)&lt;/p&gt;</comment>
                            <comment id="1186470" author="joseaio" created="Fri, 26 Feb 2016 21:57:04 +0000"  >&lt;p&gt;db.order.aggregate([&lt;br/&gt;
    {&lt;br/&gt;
       $lookup:&lt;/p&gt;
         {
           from: &quot;products&quot;,
           localField: [ &quot;localField1&quot;, &quot;localField2&quot;, ... &quot;localFieldN&quot;],
           foreignField: [ &quot;foreignField1&quot;, &quot;foreignField2&quot;, ... &quot;foreignField&quot;],
           as: &quot;productObjects&quot;
         }
&lt;p&gt;    }&lt;br/&gt;
])&lt;/p&gt;</comment>
                            <comment id="1160182" author="asya" created="Mon, 1 Feb 2016 21:24:55 +0000"  >&lt;blockquote&gt;&lt;p&gt;&quot;localField(s)&quot; and &quot;foreignField(s)&quot; must be arrays and match fields by position&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Can you explain what you are looking to do exactly, I&apos;m not sure if I&apos;m understanding this particular suggestion.&lt;/p&gt;</comment>
                            <comment id="1158868" author="joseaio" created="Sat, 30 Jan 2016 18:42:01 +0000"  >&lt;p&gt;IMO,&lt;/p&gt;

&lt;p&gt;     &quot;localField(s)&quot; and &quot;foreignField(s)&quot; must be arrays and match fields by position&lt;/p&gt;

&lt;p&gt;Another interesting feature: add a lookupOne to lookup single document and map as Object (not array) on results&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="380695">SERVER-29072</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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25143"><![CDATA[Query]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sat, 30 Jan 2016 18:42:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 11 weeks, 1 day 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-738</customfieldvalue>
                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 11 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-query</customfieldvalue>
            <customfieldvalue>cade@hyperblaster.org</customfieldvalue>
            <customfieldvalue>alice@gothcandy.com</customfieldvalue>
            <customfieldvalue>james.wahlin@mongodb.com</customfieldvalue>
            <customfieldvalue>joseaio</customfieldvalue>
            <customfieldvalue>lparayno</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkm5b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9dqf:</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_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|hrjden:</customfieldvalue>

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