<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:44:32 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-58443] Allow $near/$nearSphere on a view</title>
                <link>https://jira.mongodb.org/browse/SERVER-58443</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In view resolution we need to translate all the parts of a .find() query into equivalent aggregation stages.&#160; Currently $near and $nearSphere aren&apos;t supported on views because syntactically they&apos;re part of the .find() predicate, which becomes a $match, but semantically they also sort the results, which $match can&apos;t.&lt;/p&gt;

&lt;p&gt;We should be able to translate any .find() predicate to a combination of $geoNear and $match stages.&#160; We&apos;ll need to make $geoNear&apos;s &apos;distanceField&apos; argument optional.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1802504">SERVER-58443</key>
            <summary>Allow $near/$nearSphere on a view</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-optimization">Backlog - Query Optimization</assignee>
                                    <reporter username="david.percy@mongodb.com">David Percy</reporter>
                        <labels>
                            <label>read-only-views</label>
                    </labels>
                <created>Tue, 29 Jun 2021 16:57:34 +0000</created>
                <updated>Fri, 9 Dec 2022 23:00:46 +0000</updated>
                                                                                                <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4333910" author="david.percy" created="Thu, 3 Feb 2022 17:53:29 +0000"  >&lt;p&gt;I had to revert this because it caused a performance regression with views.  Currently when we &lt;a href=&quot;https://github.com/10gen/mongo/blob/882ebf1ad73b1c39af8b0cd82de7c648b8a860d2/src/mongo/db/query/query_request_helper.cpp#L237&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;translate find() on a view to an aggregate()&lt;/a&gt;, we don&apos;t have a parsed MatchExpression yet.  We have FindCommandRequest which has BSON for each part of the query (filter, projection, sort, etc).&lt;/p&gt;

&lt;p&gt;To handle $near/$nearSphere we need to parse the predicate so we can split it up into a conjunction of $near/$nearSphere and everything else.  For example, given find({name: &quot;abc&quot;, loc: {$near: &lt;span class=&quot;error&quot;&gt;&amp;#91;0, 0&amp;#93;&lt;/span&gt;}, temp: {$lt 70}}), we need to split it up into {name: &quot;abc&quot;, temp: {$lt: 70}} and {loc: {$near: &lt;span class=&quot;error&quot;&gt;&amp;#91;0, 0&amp;#93;&lt;/span&gt;}}.  My plan was to use CanonicalQuery, because that also takes care of flattening nested $and.  But this adds some work to all find() queries on views, which can be bad for very short queries.&lt;/p&gt;

&lt;p&gt;I believe any $near or $nearSphere query can be expressed as a $geoNear aggregation, so this feature would really be a syntax improvement.  We could reopen if that&apos;s something people would find useful.&lt;/p&gt;</comment>
                            <comment id="4011191" author="xgen-internal-githook" created="Thu, 19 Aug 2021 21:12:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;David Percy&apos;, &apos;email&apos;: &apos;david.percy@mongodb.com&apos;, &apos;username&apos;: &apos;dpercy&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-58443&quot; title=&quot;Allow $near/$nearSphere on a view&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-58443&quot;&gt;SERVER-58443&lt;/a&gt; Translate $near/$nearSphere on a view to $geoNear&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 02894677cc0eaa10fac99d2b99f18abf4fc33c74.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/986a817bb5b94f976e4b567bbda7f77ef804c19c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/986a817bb5b94f976e4b567bbda7f77ef804c19c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4011189" author="xgen-internal-githook" created="Thu, 19 Aug 2021 21:12:02 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;David Percy&apos;, &apos;email&apos;: &apos;david.percy@mongodb.com&apos;, &apos;username&apos;: &apos;dpercy&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-58443&quot; title=&quot;Allow $near/$nearSphere on a view&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-58443&quot;&gt;SERVER-58443&lt;/a&gt; Translate $near/$nearSphere on a view to $geoNear&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 65fec2e68f4ae57d2218290ee6744648a18a2ed4.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/10gen/mongo-enterprise-modules/commit/88e0594f0e1a7a6b62a5a52103b6ec953007c78a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo-enterprise-modules/commit/88e0594f0e1a7a6b62a5a52103b6ec953007c78a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3996217" author="xgen-internal-githook" created="Wed, 11 Aug 2021 21:08:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;David Percy&apos;, &apos;email&apos;: &apos;david.percy@mongodb.com&apos;, &apos;username&apos;: &apos;dpercy&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-58443&quot; title=&quot;Allow $near/$nearSphere on a view&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-58443&quot;&gt;SERVER-58443&lt;/a&gt; Translate $near/$nearSphere on a view to $geoNear&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/02894677cc0eaa10fac99d2b99f18abf4fc33c74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/02894677cc0eaa10fac99d2b99f18abf4fc33c74&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3996216" author="xgen-internal-githook" created="Wed, 11 Aug 2021 21:08:30 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;David Percy&apos;, &apos;email&apos;: &apos;david.percy@mongodb.com&apos;, &apos;username&apos;: &apos;dpercy&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-58443&quot; title=&quot;Allow $near/$nearSphere on a view&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-58443&quot;&gt;SERVER-58443&lt;/a&gt; Translate $near/$nearSphere on a view to $geoNear&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/10gen/mongo-enterprise-modules/commit/65fec2e68f4ae57d2218290ee6744648a18a2ed4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo-enterprise-modules/commit/65fec2e68f4ae57d2218290ee6744648a18a2ed4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3949762" author="xgen-internal-githook" created="Mon, 19 Jul 2021 15:39:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;David Percy&apos;, &apos;email&apos;: &apos;david.percy@mongodb.com&apos;, &apos;username&apos;: &apos;dpercy&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-58443&quot; title=&quot;Allow $near/$nearSphere on a view&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-58443&quot;&gt;SERVER-58443&lt;/a&gt; Make $geoNear distanceField optional&lt;br/&gt;
Branch: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-58443&quot; title=&quot;Allow $near/$nearSphere on a view&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-58443&quot;&gt;SERVER-58443&lt;/a&gt;-translate-near-to-geoNear&lt;br/&gt;
&lt;a href=&quot;https://github.com/10gen/mongo-enterprise-modules/commit/127f169242a44f56f3c0ee76a99c0a13ecab6df1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo-enterprise-modules/commit/127f169242a44f56f3c0ee76a99c0a13ecab6df1&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="1860791">SERVER-59612</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1974383">SERVER-63146</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="558681">SERVER-35581</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1792627">SERVER-57932</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25126"><![CDATA[Query Optimization]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 12 Jul 2021 18:10:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>163.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>david.percy@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzphh3:</customfieldvalue>

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

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