<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:10:14 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-5916] In $group allow &quot;$$ROOT&quot; to expand to the whole document matched.</title>
                <link>https://jira.mongodb.org/browse/SERVER-5916</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Allow:&lt;br/&gt;
  db.coll.aggregate({$group:{_id:&quot;$field&quot;, docs:{$push:&quot;$$ROOT&quot;}}});&lt;/p&gt;

&lt;p&gt;Currently {$push:&quot;$field&quot;} is supported, which accumulates a field from the document. Adding support for &quot;$$ROOT&quot; to expand to the full document would seem to make sense then.&lt;/p&gt;</description>
                <environment></environment>
        <key id="39491">SERVER-5916</key>
            <summary>In $group allow &quot;$$ROOT&quot; to expand to the whole document matched.</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="tanglebones">Clifford Hammerschmidt</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 May 2012 23:24:14 +0000</created>
                <updated>Mon, 11 Jul 2016 18:33:47 +0000</updated>
                            <resolved>Tue, 24 Sep 2013 21:22:27 +0000</resolved>
                                    <version>2.1.1</version>
                                    <fixVersion>2.5.3</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>5</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="430738" author="auto" created="Tue, 24 Sep 2013 21:17:44 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-5916&quot; title=&quot;In $group allow &amp;quot;$$ROOT&amp;quot; to expand to the whole document matched.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-5916&quot;&gt;&lt;del&gt;SERVER-5916&lt;/del&gt;&lt;/a&gt; Allow bare $$ROOT or $$CURRENT without subfields&lt;/p&gt;

&lt;p&gt;This represents the whole variable (usually the full incoming document).&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c30d78afdab3cfc95d1ece9f1e8680b7a2e1dc28&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c30d78afdab3cfc95d1ece9f1e8680b7a2e1dc28&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="427457" author="redbeard0531" created="Tue, 17 Sep 2013 21:34:58 +0000"  >&lt;p&gt;This should be handled by the $$ROOT variable introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9840&quot; title=&quot;Add variables, $$ROOT and $$CURRENT to aggregation and make $let to set them&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9840&quot;&gt;&lt;del&gt;SERVER-9840&lt;/del&gt;&lt;/a&gt;. I updated the example code to use the syntax from that ticket. I&apos;m leaving this ticket open to add a test using this code.&lt;/p&gt;</comment>
                            <comment id="218756" author="tanglebones" created="Tue, 18 Dec 2012 23:21:37 +0000"  >&lt;p&gt;I&apos;m hoping this is a quick and easy one.&lt;/p&gt;

&lt;p&gt;The main use would be for partitioning data into N sets.&lt;/p&gt;

&lt;p&gt;Support in $project may make more sense since then you can do:&lt;/p&gt;

&lt;p&gt;db.x.aggregate(&lt;br/&gt;
 { $project { computed: {$toLower:{ &apos;$address.state_code&apos; }}, doc: &apos;$&apos; } },&lt;br/&gt;
 { $group { _id: &apos;$computed&apos;, docs: &lt;/p&gt;
{ $push: &apos;$doc&apos;}
&lt;p&gt; } }&lt;br/&gt;
);&lt;/p&gt;

&lt;p&gt;This would allow for grouping data in a collection based on a computation of the data without having to specify all the fields in both the $project and the $group statements. It also feel more inline with the idea of &quot;schemaless&quot; data as it doesn&apos;t force the documents processed to have anything other than the fields used in the computation present and makes the aggregation query more reusable in general.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="77473">SERVER-9840</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>3.0</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>Tue, 17 Sep 2013 21:34:58 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 21 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_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>
                            10 years, 21 weeks, 1 day 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>auto</customfieldvalue>
            <customfieldvalue>tanglebones</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hro22n:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7841</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_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10154"><![CDATA[Complete]]></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|hrjcqv:</customfieldvalue>

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