<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:07:44 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-5048] $project to have ability to get data from referenced collections (SQL-like &quot;join&quot;)</title>
                <link>https://jira.mongodb.org/browse/SERVER-5048</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Aggregation framework looks very promising for manipulation of results from read query prior to passing back to the client. It would be great if a facility similar to SQL: &quot;fields: &lt;/p&gt;
{ collection1.field1, collection2.field2 }
&lt;p&gt;, joinOn: &lt;/p&gt;
{ collection1.refSourceField, collection2.refTargetField }
&lt;p&gt; was available. In effect the syntax for $join or similar would have the developer specify:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;What field they want to get from a target or referenced collection&lt;/li&gt;
	&lt;li&gt;What field in their source collection has a look-up to the target collection&lt;/li&gt;
	&lt;li&gt;What field in the target collection is referenced from the source.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Obviously this is only useful in cases where data is not denormalized...enterprise systems with large numbers of master data updates cannot denormalize fully because of the pain of mass updates. For example if we have two collections:&lt;/p&gt;

&lt;p&gt;1. Employee.ID = mongoID &amp;amp; Employee.name.fullName = &quot;Fred Flintstone&quot;&lt;br/&gt;
2. Project.ID = mongoID &amp;amp; Project.responsibleMgr = mongoID of the employee who is the project manager&lt;br/&gt;
(assume Employee.name.fullName is not denormalized because it is referenced many times and people get married/change names)&lt;/p&gt;

&lt;p&gt;When reading the Project collection we can only get the mongo ID of the project mgr which is not that useful. If the client does a second read of Employee where ID = Project.responsibleMgr to get their name this is ok but extra burden on the client-ui developer and two http requests. Of course a custom api on the server would avoid the two http requests but is again more work.&lt;/p&gt;

&lt;p&gt;It would be great if in this example we can use $join notation to say something like &quot;fields: &lt;/p&gt;
{ Project.ID, Project.responsibleMgr, Employee.name.fullName }
&lt;p&gt;, joinOn: &lt;/p&gt;
{ Employee.ID, Project.responsibleMgr }
&lt;p&gt;&quot; and get everything back at once from one query.&lt;/p&gt;</description>
                <environment></environment>
        <key id="31317">SERVER-5048</key>
            <summary>$project to have ability to get data from referenced collections (SQL-like &quot;join&quot;)</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="-1">Unassigned</assignee>
                                    <reporter username="richard.minney">Richard Minney</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Feb 2012 06:43:27 +0000</created>
                <updated>Thu, 25 Jun 2015 14:20:13 +0000</updated>
                            <resolved>Thu, 25 Jun 2015 14:20:04 +0000</resolved>
                                                                    <component>Aggregation Framework</component>
                                        <votes>4</votes>
                                    <watches>12</watches>
                                                                                                                <comments>
                            <comment id="950545" author="ian@10gen.com" created="Thu, 25 Jun 2015 14:20:04 +0000"  >&lt;p&gt;Hi Richard, thanks a lot for filing this feature request and my apologies for the time since it was last updated.&lt;/p&gt;

&lt;p&gt;I&apos;m going to close this as a Duplicate and link it to our upcoming $lookup feature - we&#8217;ve decided to progress along fairly similar lines of your suggestion and provide users with the desired functionality via this new operator in the aggregation pipeline. Please follow along in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-19095&quot; title=&quot;$lookup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-19095&quot;&gt;&lt;del&gt;SERVER-19095&lt;/del&gt;&lt;/a&gt; for further details of the $lookup implementation.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="212584">SERVER-19095</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>Thu, 25 Jun 2015 14:20:04 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 33 weeks, 6 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>ian@mongodb.com</customfieldvalue>
            <customfieldvalue>richard.minney</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrocnr:</customfieldvalue>

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

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

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