<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:55:55 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-20994] 2dsphere index</title>
                <link>https://jira.mongodb.org/browse/SERVER-20994</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Config. : single-node, unsharded, MongoDB v2.6.5 running on Mac OS X Yosemite.&lt;/p&gt;

&lt;p&gt;I have a collection of about 240,000 documents. Each document contains many fields, and a &quot;location&quot; field which in turn always has two sub-fields: latitude and longitude. My backend needs to perform geospatial queries on the collection.&lt;/p&gt;

&lt;p&gt;I thusly created a compound index with the fields declared in the following order:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;location: &quot;2dsphere&quot;&lt;/li&gt;
	&lt;li&gt;all the other fields regardless of the order&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This index works, but is not optimal, as the MongoDB staff told me during the Paris Mongo Days conference. I therefore changed the order of the fields, according to their advice. The order became:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;equality fields&lt;/li&gt;
	&lt;li&gt;range fields&lt;/li&gt;
	&lt;li&gt;location: &quot;2dsphere&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Furthermore, this page :&lt;br/&gt;
&lt;a href=&quot;http://docs.mongodb.org/manual/tutorial/build-a-2dsphere-index/#create-a-compound-index-with-2dsphere-index-key&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://docs.mongodb.org/manual/tutorial/build-a-2dsphere-index/#create-a-compound-index-with-2dsphere-index-key&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;states the following regarding the 2dsphere index in MongoDB v2.6:&lt;br/&gt;
&quot;Unlike the 2d index, a compound 2dsphere index does not require the location field to be the first field indexed.&quot;&lt;/p&gt;

&lt;p&gt;However, when I changed the order of the index&apos; fields and placed the location field in the last position, I get the following error message : &lt;/p&gt;

&lt;p&gt; planner returned error: unable to find index for $geoNear query&lt;br/&gt;
	at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:90)&lt;br/&gt;
	at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException(MongoTemplate.java:1934)&lt;br/&gt;
	at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:1817)&lt;br/&gt;
	at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1628)&lt;br/&gt;
	at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1611)&lt;br/&gt;
	at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:535)&lt;br/&gt;
	at org.springframework.data.mongodb.repository.query.AbstractMongoQuery$Execution.readCollection(AbstractMongoQuery.java:168)&lt;br/&gt;
	at org.springframework.data.mongodb.repository.query.AbstractMongoQuery$CollectionExecution.execute(AbstractMongoQuery.java:191)&lt;br/&gt;
	at org.springframework.data.mongodb.repository.query.AbstractMongoQuery.execute(AbstractMongoQuery.java:103)&lt;br/&gt;
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:421)&lt;br/&gt;
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:381)&lt;br/&gt;
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)&lt;br/&gt;
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)&lt;br/&gt;
	at com.sun.proxy.$Proxy20.findNearEventWithCategoryV2(Unknown Source)&lt;br/&gt;
	at com.XXXXXX.mongodbbenchmark.Main.run(Main.java:69)&lt;br/&gt;
	at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:677)&lt;br/&gt;
	... 5 more&lt;/p&gt;</description>
                <environment></environment>
        <key id="234899">SERVER-20994</key>
            <summary>2dsphere index</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="elyesgherib">Elyes Gherib</reporter>
                        <labels>
                    </labels>
                <created>Sun, 18 Oct 2015 13:12:39 +0000</created>
                <updated>Sun, 18 Oct 2015 14:13:25 +0000</updated>
                            <resolved>Sun, 18 Oct 2015 13:41:17 +0000</resolved>
                                    <version>2.6.5</version>
                                                    <component>Geo</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1063709" author="elyesgherib" created="Sun, 18 Oct 2015 14:13:25 +0000"  >&lt;p&gt;Duly noted.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Elyes.&lt;/p&gt;</comment>
                            <comment id="1063706" author="ramon.fernandez" created="Sun, 18 Oct 2015 13:41:17 +0000"  >&lt;p&gt;Thanks for the followup &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=elyesgherib&quot; class=&quot;user-hover&quot; rel=&quot;elyesgherib&quot;&gt;elyesgherib&lt;/a&gt;. Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the &lt;a href=&quot;http://groups.google.com/group/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user group&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com/questions/tagged/mongodb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Stack Overflow with the &lt;tt&gt;mongodb&lt;/tt&gt; tag&lt;/a&gt;, where your question will reach a larger audience. A question like this involving more discussion would be best posted on the &lt;a href=&quot;http://groups.google.com/group/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user group&lt;/a&gt;. See also our &lt;a href=&quot;https://www.mongodb.org/about/support/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Technical Support page&lt;/a&gt; for additional support resources.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Ram&#243;n.&lt;/p&gt;</comment>
                            <comment id="1063705" author="elyesgherib" created="Sun, 18 Oct 2015 13:36:35 +0000"  >&lt;p&gt;Please close this, it&apos;s my mistake. &lt;br/&gt;
I mistyped a field name in the index, and therefore the query planner couldn&apos;t choose the index that I created.&lt;/p&gt;

&lt;p&gt;It works now.&lt;/p&gt;</comment>
                            <comment id="1063703" author="elyesgherib" created="Sun, 18 Oct 2015 13:20:36 +0000"  >&lt;p&gt;Update: rebuilding the indexes or restarting the node doesn&apos;t fix the problem.&lt;/p&gt;</comment>
                            <comment id="1063702" author="ramon.fernandez" created="Sun, 18 Oct 2015 13:17:26 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=elyesgherib&quot; class=&quot;user-hover&quot; rel=&quot;elyesgherib&quot;&gt;elyesgherib&lt;/a&gt;, can you please send the output of &lt;tt&gt;db.col.getIndexes()&lt;/tt&gt; for this collection as well as the query you&apos;re running?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Ram&#243;n.&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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sun, 18 Oct 2015 13:17:26 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 17 weeks, 3 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>elyesgherib</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 17 weeks, 3 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>elyesgherib</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|hrkrhb:</customfieldvalue>

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

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