<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:07:28 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-44957] Proposal: $find aggregation pipeline operator</title>
                <link>https://jira.mongodb.org/browse/SERVER-44957</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When filtering&#160;arrays we often need to reduce to the first element matching a condition. This is currently achievable with the following:&lt;/p&gt;

&lt;p&gt;{&lt;tt&gt;$project: {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; action: {$arrayElemAt: [{$filter: {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; input: &apos;$actions&apos;,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; cond: {$eq: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;$$this.id&amp;#39;, &amp;#39;$id&amp;#39;&amp;#93;&lt;/span&gt;},&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; }}, 0]},&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;}&lt;/tt&gt;}&lt;/p&gt;

&lt;p&gt;A cleaner and more performant option would be to have a dedicated `find` operator: &lt;/p&gt;

&lt;p&gt;{&lt;tt&gt;$project: {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; action: {$find: {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; input: &apos;$actions&apos;,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; cond: {$eq: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;$$this.id&amp;#39;, &amp;#39;$id&amp;#39;&amp;#93;&lt;/span&gt;},&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; }},&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;}&lt;/tt&gt;}&lt;/p&gt;

&lt;p&gt;This idea is analagous to the ECMAScript Array.prototype.find, and would compliment the &apos;$filter&apos;, &apos;$map&apos;, and &apos;$reduce&apos; operators that are already implemented.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="1038054">SERVER-44957</key>
            <summary>Proposal: $find aggregation pipeline operator</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="pete@duel.me">Pete Boere</reporter>
                        <labels>
                            <label>qopt-team</label>
                    </labels>
                <created>Thu, 5 Dec 2019 11:54:13 +0000</created>
                <updated>Tue, 6 Dec 2022 02:40:46 +0000</updated>
                            <resolved>Thu, 5 Dec 2019 22:12:13 +0000</resolved>
                                                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2586967" author="david.storch" created="Thu, 5 Dec 2019 22:11:50 +0000"  >&lt;p&gt;Thanks for the feature request &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pete%40duel.me&quot; class=&quot;user-hover&quot; rel=&quot;pete@duel.me&quot;&gt;pete@duel.me&lt;/a&gt;! I&apos;m closing this as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44441&quot; title=&quot;aggregation framework should have a $find expression&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44441&quot;&gt;SERVER-44441&lt;/a&gt;. Let us know if we missed something and you believe these two tickets are distinct.&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
Dave&lt;/p&gt;</comment>
                            <comment id="2586661" author="carl.champain" created="Thu, 5 Dec 2019 19:32:01 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pete%40duel.me&quot; class=&quot;user-hover&quot; rel=&quot;pete@duel.me&quot;&gt;pete@duel.me&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for the example. We&apos;re assigning this ticket to the Query team for further investigation. Updates will be posted on this ticket as they happen.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
 Carl&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="990456">SERVER-44441</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>2.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 5 Dec 2019 19:32:01 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 9 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-query</customfieldvalue>
            <customfieldvalue>carl.champain@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>pete@duel.me</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hw8dtz:</customfieldvalue>

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

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