<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:41:36 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>[DOCS-1669] aggregation $group reverses previous $sort</title>
                <link>https://jira.mongodb.org/browse/DOCS-1669</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;aggregation $group operation reverses previous $sort operation.&lt;/p&gt;

&lt;p&gt;this must be fixed or documented in $group and $sort that $sort will be broken /reverted if it was used before $group&lt;/p&gt;</description>
                <environment>win7 64bit</environment>
        <key id="80986">DOCS-1669</key>
            <summary>aggregation $group reverses previous $sort</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="sam.kleinman">Sam Kleinman</assignee>
                                    <reporter username="mutyonok">Oleksii Lomako</reporter>
                        <labels>
                            <label>aggregation</label>
                            <label>group</label>
                            <label>sort</label>
                    </labels>
                <created>Tue, 2 Jul 2013 10:40:59 +0000</created>
                <updated>Sun, 25 Aug 2019 06:58:54 +0000</updated>
                            <resolved>Tue, 2 Jul 2013 13:55:30 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2385491" author="deadmann" created="Sun, 25 Aug 2019 06:58:35 +0000"  >&lt;p&gt;Just curious, and unrelated...&lt;/p&gt;

&lt;p&gt;what&apos;s `u` in that json? is it valid? or it used in specific language?&#160;&lt;br/&gt;
 &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-1669?focusedCommentId=372477&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-372477&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/DOCS-1669?focusedCommentId=372477&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-372477&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1306465" author="fresheneesz" created="Fri, 24 Jun 2016 22:56:06 +0000"  >&lt;p&gt;Why does $group eff up the sort? This seems unnecessarily confusing to me. &lt;/p&gt;</comment>
                            <comment id="372481" author="samk" created="Tue, 2 Jul 2013 13:58:16 +0000"  >&lt;p&gt;The first $sort can use an index if there are no $project, $unwind or $group pipeline stages that proceed the $sort.  &lt;/p&gt;</comment>
                            <comment id="372477" author="auto" created="Tue, 2 Jul 2013 13:53:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;tychoish&apos;, u&apos;name&apos;: u&apos;Sam Kleinman&apos;, u&apos;email&apos;: u&apos;samk@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-1669&quot; title=&quot;aggregation $group reverses previous $sort&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-1669&quot;&gt;&lt;del&gt;DOCS-1669&lt;/del&gt;&lt;/a&gt;: adding note about ordering of group output.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/06bdb71347cdc3c8d9b8891ed2efee1c55221792&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/06bdb71347cdc3c8d9b8891ed2efee1c55221792&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="372476" author="auto" created="Tue, 2 Jul 2013 13:53:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;tychoish&apos;, u&apos;name&apos;: u&apos;Sam Kleinman&apos;, u&apos;email&apos;: u&apos;samk@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-1669&quot; title=&quot;aggregation $group reverses previous $sort&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-1669&quot;&gt;&lt;del&gt;DOCS-1669&lt;/del&gt;&lt;/a&gt;: adding note about ordering of group output.&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/9bd0ef54649350431274c0e2b8281e04d1a79abc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/9bd0ef54649350431274c0e2b8281e04d1a79abc&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="372472" author="mutyonok" created="Tue, 2 Jul 2013 13:49:14 +0000"  >&lt;p&gt;Am i right that we cannot rely on such sorting &quot;invertion&quot; and must use $sort second time after $group?&lt;br/&gt;
the pipeline will be then:&lt;br/&gt;
$sort -&amp;gt; $group -&amp;gt; $sort&lt;/p&gt;

&lt;p&gt;does first $sort make any optimization (we assume that we have index on keys)?&lt;/p&gt;</comment>
                            <comment id="372465" author="eliot" created="Tue, 2 Jul 2013 13:45:26 +0000"  >&lt;p&gt;This is definitely as expected.&lt;/p&gt;

&lt;p&gt;The output of group is by definition not-ordered, that should be clear in the docs.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="28527" name="test.json" size="526" author="mutyonok" created="Tue, 2 Jul 2013 10:40:59 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 2 Jul 2013 13:45:26 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 24 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>fresheneesz</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>deadmann</customfieldvalue>
            <customfieldvalue>mutyonok</customfieldvalue>
            <customfieldvalue>sam.kleinman</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrrt6f:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>74036</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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrz7hb:</customfieldvalue>

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