<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:02:52 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-3362] allow query option to return found documents enclosed in a &quot;meta&quot; document containing array offset information</title>
                <link>https://jira.mongodb.org/browse/SERVER-3362</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;if i have a collection of documents like:&lt;/p&gt;

&lt;p&gt;{ name: &apos;fred&apos;, children: [&lt;/p&gt;
{ name: &apos;bill&apos;, age: 10 }
&lt;p&gt;, &lt;/p&gt;
{ name: &apos;bob&apos;, age: 20 }
&lt;p&gt;, &lt;/p&gt;
{ name: &apos;ed&apos;, age: 30 }
&lt;p&gt;] }&lt;/p&gt;

&lt;p&gt;and i want to operate on all children whose age is greater than 10, i don&apos;t believe there is a direct way to accomplish this.&lt;/p&gt;

&lt;p&gt;i&apos;m coming at this from the context of this jira entry: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3347&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-3347&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i believe in the multi-geo case the document is returned once for each hit, which implies that multiple elements of an array met the search criteria.&lt;/p&gt;

&lt;p&gt;in the multi-non-geo case the document is returned only once, i think it would be best to remain consistent, and in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3347&quot; title=&quot;Option for not only closest distance but also closest location in $geoNear, potentially $near&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3347&quot;&gt;SERVER-3347&lt;/a&gt; i suggest returning the document only once (after all returning the same document multiple times doesn&apos;t add much value),&lt;br/&gt;
but i allude to a &quot;wrapper&quot; document containing &quot;meta&quot; information on which elements of the array met the uery criteria.&lt;/p&gt;

&lt;p&gt;i think the same pattern may be applicable to the multi-non-geo case, in a way to address the case in between the $ position operator and the multi (apply to all) mechanism.&lt;/p&gt;

&lt;p&gt;so if there was a way to return something like:&lt;/p&gt;

&lt;p&gt;{ &lt;br/&gt;
  hits: [ &lt;br/&gt;
    &lt;/p&gt;
{field: &quot;children.age&quot;, index: 1 }
&lt;p&gt;, &lt;/p&gt;
    {field: &quot;children.age&quot;, index: 2 } 
&lt;p&gt;  ], &lt;br/&gt;
  document: &lt;/p&gt;
{ // the actual document }
&lt;p&gt; &lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;i think it would give the caller enough information to operate on those elements of the array that were of interest...? &lt;/p&gt;</description>
                <environment></environment>
        <key id="19027">SERVER-3362</key>
            <summary>allow query option to return found documents enclosed in a &quot;meta&quot; document containing array offset information</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="tony_k">tony kerz</reporter>
                        <labels>
                    </labels>
                <created>Sun, 3 Jul 2011 00:58:44 +0000</created>
                <updated>Tue, 6 Dec 2022 05:42:29 +0000</updated>
                                                                            <component>Querying</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                        <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 33 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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 33 weeks, 4 days 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>backlog-query-execution</customfieldvalue>
            <customfieldvalue>tony_k</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrowkn:</customfieldvalue>

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

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

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