<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:35:15 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-14565] New aggregation operators</title>
                <link>https://jira.mongodb.org/browse/SERVER-14565</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It would be useful to me if there were a few new operations in the agg framework in the Array Aggregation Operators section (alongside the existing operator $size, perhaps? Or the new $max/$min operators could be alongside the arithmetic operators $add, $multiply, etc.)&lt;/p&gt;

&lt;p&gt;//existing operator $size for reference&lt;br/&gt;
$size : &lt;span class=&quot;error&quot;&gt;&amp;#91;1,2,3,3,3&amp;#93;&lt;/span&gt;&lt;br/&gt;
//returns 5&lt;/p&gt;

&lt;p&gt;//NEW operator $selectIndex&lt;br/&gt;
//I&apos;m sure there could be different ways to make the syntax work, but here is one example&lt;br/&gt;
$selectIndex : &lt;/p&gt;
{[1,2,3,3,3] : 4}
&lt;p&gt;//returns 3&lt;/p&gt;

&lt;p&gt;//NEW operator $max&lt;br/&gt;
//different than existing $max operator which is used in the group stage and only takes one value as a parameter&lt;br/&gt;
$max : &lt;span class=&quot;error&quot;&gt;&amp;#91;1,2,3,3,3&amp;#93;&lt;/span&gt;&lt;br/&gt;
//returns 3&lt;br/&gt;
$max : &lt;span class=&quot;error&quot;&gt;&amp;#91;$field1, $field2&amp;#93;&lt;/span&gt;&lt;br/&gt;
//returns the whichever value is greater in field1 or field2&lt;/p&gt;

&lt;p&gt;//NEW operator $min&lt;br/&gt;
$min: &lt;span class=&quot;error&quot;&gt;&amp;#91;1,2,3,3,3&amp;#93;&lt;/span&gt;&lt;br/&gt;
//returns 1&lt;br/&gt;
$min : &lt;span class=&quot;error&quot;&gt;&amp;#91;$field1, $field2&amp;#93;&lt;/span&gt;&lt;br/&gt;
//returns the whichever value is least in field1 or field2&lt;/p&gt;

&lt;p&gt;in particular, the $selectIndex operator would be very valuable to me to convert an array into a simple value, as seen in this mongo google group posting:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://groups.google.com/forum/#!topic/mongodb-user/qmtAeojf68g&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://groups.google.com/forum/#!topic/mongodb-user/qmtAeojf68g&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="147260">SERVER-14565</key>
            <summary>New aggregation operators</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="ramon.fernandez@mongodb.com">Ramon Fernandez Marina</assignee>
                                    <reporter username="nefiga">Ben Rotz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jul 2014 16:22:40 +0000</created>
                <updated>Fri, 20 Mar 2015 18:21:38 +0000</updated>
                            <resolved>Wed, 16 Jul 2014 14:23:47 +0000</resolved>
                                                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="859455" author="asya" created="Fri, 20 Mar 2015 18:21:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nefiga&quot; class=&quot;user-hover&quot; rel=&quot;nefiga&quot;&gt;nefiga&lt;/a&gt;  would a $slice array operator in $project allow you to accomplish what you described with your $selectIndex operator?&lt;/p&gt;</comment>
                            <comment id="662578" author="nefiga" created="Fri, 18 Jul 2014 00:00:34 +0000"  >&lt;p&gt;While I agree that &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9625&quot; title=&quot;Support many accumulators in aggregation framework as expressions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9625&quot;&gt;&lt;del&gt;SERVER-9625&lt;/del&gt;&lt;/a&gt; is a duplicate of half of my issue, I don&apos;t think that &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4588&quot; title=&quot;aggregation: add option to $unwind to emit array index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4588&quot;&gt;&lt;del&gt;SERVER-4588&lt;/del&gt;&lt;/a&gt; is a duplicate of the $selectIndex idea.&lt;/p&gt;

&lt;p&gt;I have hundreds of millions of rows in one collection, which have a field that corresponds to a much smaller collection (thousands). I&apos;d love to be able to &quot;join&quot; to this other collection in memory to pull fields that are more dynamic in the smaller collection for purposes of aggregating in a $group stage.&lt;/p&gt;

&lt;p&gt;This could easily be done if there was some sort of $selectedIndex in the array operators section of the aggregation framework, right next to $size, because then the array just becomes an in-memory array in a $let clause. Both of these operators can project an array into a single field, which is exactly what I want.&lt;/p&gt;
</comment>
                            <comment id="660524" author="ramon.fernandez" created="Wed, 16 Jul 2014 14:23:19 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nefiga&quot; class=&quot;user-hover&quot; rel=&quot;nefiga&quot;&gt;nefiga&lt;/a&gt;, similar functionality has already been requested in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9625&quot; title=&quot;Support many accumulators in aggregation framework as expressions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9625&quot;&gt;&lt;del&gt;SERVER-9625&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4588&quot; title=&quot;aggregation: add option to $unwind to emit array index&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4588&quot;&gt;&lt;del&gt;SERVER-4588&lt;/del&gt;&lt;/a&gt;. See the former for information on how to accomplish what you need with some helper functions.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="27497">SERVER-4588</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="74681">SERVER-9625</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                                        </inwardlinks>
                                    </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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 16 Jul 2014 14:23:19 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 47 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>nefiga</customfieldvalue>
            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlrnz:</customfieldvalue>

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

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

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