<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:06 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-2142] Allow the ability to return a subset of the elements in an array property</title>
                <link>https://jira.mongodb.org/browse/SERVER-2142</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Given a websites collection with a document &lt;/p&gt;
{ _id: 0, domain: &quot;mongodb.org&quot;, &quot;like&quot;: [1, 2, 3, 4, 5] } 
&lt;p&gt;where like represents the ids of all users who have &quot;liked&quot; the document,&lt;/p&gt;

&lt;p&gt;Allow a query such as:  &lt;/p&gt;

&lt;p&gt;db.websites.find( &lt;/p&gt;
{ domain : &quot;mongodb.org&apos;&apos; }
&lt;p&gt;, { like : {$in : &lt;span class=&quot;error&quot;&gt;&amp;#91;4, 5, 6&amp;#93;&lt;/span&gt; } } );&lt;/p&gt;

&lt;p&gt;resulting in&lt;/p&gt;

{ _id:0, domain: &quot;mongodb.org&quot;, &quot;like&quot;: [4, 5] }

&lt;p&gt;Currently, the only way to do this is to filter client side or store the data in a more normalized fashion.&lt;/p&gt;</description>
                <environment></environment>
        <key id="13789">SERVER-2142</key>
            <summary>Allow the ability to return a subset of the elements in an array property</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="ryan.m.wynn@gmail.com">Ryan Wynn</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Nov 2010 01:37:07 +0000</created>
                <updated>Tue, 16 Nov 2021 18:15:38 +0000</updated>
                            <resolved>Tue, 24 Sep 2013 21:42:49 +0000</resolved>
                                                                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="430756" author="ian@10gen.com" created="Tue, 24 Sep 2013 21:42:49 +0000"  >&lt;p&gt;Done with elemMatch (&lt;a href=&quot;http://docs.mongodb.org/manual/reference/operator/elemMatch/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://docs.mongodb.org/manual/reference/operator/elemMatch/&lt;/a&gt;)&lt;/p&gt;</comment>
                            <comment id="64988" author="ypcxyz" created="Sun, 6 Nov 2011 13:49:57 +0000"  >&lt;p&gt;This would be especially useful when instead of the numbers &lt;span class=&quot;error&quot;&gt;&amp;#91;1, 2, 3, 4, ...&amp;#93;&lt;/span&gt; there are actual objects. Returning the whole array in such case is wasteful, if the array is big.&lt;/p&gt;

&lt;p&gt;Similarly, it would be great if the .$. operator was usable for filtering the returned fields, e.g.&lt;/p&gt;

&lt;p&gt;db.col = [ { subarr: [ &lt;/p&gt;
{ id: &apos;obj1&apos; }
&lt;p&gt;, &lt;/p&gt;
{ id: &apos;obj2&apos; }
&lt;p&gt; ] }, ... ];&lt;/p&gt;

&lt;p&gt;db.col.find(&lt;/p&gt;
{ &apos;subarr.id&apos;: &apos;obj2&apos; }
&lt;p&gt;, &lt;/p&gt;
{ &apos;subarr.$.id&apos;: 1 }
&lt;p&gt;)...*&lt;/p&gt;

&lt;p&gt;..meaning: only return the matched element of the matched obj.array, and only its &apos;id&apos; field (in this example).&lt;/p&gt;

&lt;p&gt;Since it&apos;s not possible to use the field filtering this way, the whole array is returned and the client needs to do the searching in it again. I&apos;m not sure if I should open a new ticket for this, I think it&apos;s the same issue.&lt;/p&gt;

&lt;p&gt;*actually a syntax like &apos;subarr&lt;span class=&quot;error&quot;&gt;&amp;#91;$&amp;#93;&lt;/span&gt;.id&apos; might be more intuitive there (in the returned field subset filtering clause).&lt;/p&gt;</comment>
                            <comment id="20654" author="eliot" created="Wed, 24 Nov 2010 01:39:58 +0000"  >&lt;p&gt;I think there are other cases that cover this - but can&apos;t find them at the moment&lt;/p&gt;</comment>
                    </comments>
                    <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, 24 Nov 2010 01:39: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>luke.bonanomi@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>eliot</customfieldvalue>
            <customfieldvalue>ian@mongodb.com</customfieldvalue>
            <customfieldvalue>ypcxyz</customfieldvalue>
            <customfieldvalue>ryan.m.wynn@gmail.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpayf:</customfieldvalue>

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

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

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