<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:21:01 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-9639] 2dsphere indexes with {2dsphereIndexVersion:2} should be sparse on geo fields</title>
                <link>https://jira.mongodb.org/browse/SERVER-9639</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Starting in 2.6.0-rc0, there are two versions of 2dsphere indexes.  All new 2dsphere indexes starting in 2.6.0-rc0 are created with {&lt;tt&gt;2dsphereIndexVersion:2&lt;/tt&gt;}.  The V2 behavior is consistent with the behavior of 2d indexes with regards to &apos;sparseness&apos;  &lt;/p&gt;

&lt;p&gt;{&lt;tt&gt;2dsphereIndexVersion: 1&lt;/tt&gt;} indexes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Do not support new GeoJSON geometries introduced in 2.5.0: (MultiPoint, MultiLineString, MultiPolygon,&lt;br/&gt;
GeometryCollection).&lt;/li&gt;
	&lt;li&gt;Are not sparse and do not recognize the 
{sparse: true}
&lt;p&gt; index modifier.&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;Documents which contain null or &quot;empty&quot; [] for the geo field are rejected and not inserted into the collection.&lt;/li&gt;
	&lt;li&gt;Documents with the geo field undefined are indexed and added to the collection.&lt;/li&gt;
	&lt;li&gt;It is possible to preserve the V1 behavior by indicating the version when creating the index.  See &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12175&quot; title=&quot;Version 2dsphere indexes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12175&quot;&gt;&lt;del&gt;SERVER-12175&lt;/del&gt;&lt;/a&gt;.&lt;br/&gt;
For example, &lt;tt&gt;coll.ensureIndex( {geo: &quot;2dsphere&quot;}, {&quot;2dsphereIndexVersion&quot;: 1});&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;{&lt;tt&gt;2dsphereIndexVersion: 2&lt;/tt&gt;} indexes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Ignore the sparse flag and print a warning to the server log if it&apos;s set.&lt;/li&gt;
	&lt;li&gt;If a document lacks a 2dsphere-indexed field (or the field is null or an empty array) the document is inserted but not added to the index.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br/&gt;
&lt;b&gt;Original Ticket Description&lt;/b&gt;&lt;br/&gt;
2dsphere indexes does not honor the sparse option. By contrast, 2d indexes are &quot;sparse&quot; by default and require all the fields from the index definition to be present in the document for the document to be included in the index.&lt;/p&gt;

&lt;p&gt;Don&apos;t know if this is an oversight or by design, but sparse functionality for 2dsphere is usable in the same way as sparse is usable for &quot;normal&quot; indexes.&lt;/p&gt;</description>
                <environment></environment>
        <key id="74833">SERVER-9639</key>
            <summary>2dsphere indexes with {2dsphereIndexVersion:2} should be sparse on geo fields</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="hari.khalsa@10gen.com">hari.khalsa@10gen.com</assignee>
                                    <reporter username="jhn">Johan Hedin</reporter>
                        <labels>
                            <label>geo</label>
                            <label>indexing</label>
                            <label>sparse</label>
                    </labels>
                <created>Thu, 9 May 2013 18:04:53 +0000</created>
                <updated>Mon, 10 Mar 2014 00:40:06 +0000</updated>
                            <resolved>Thu, 20 Feb 2014 05:20:15 +0000</resolved>
                                    <version>2.4.3</version>
                                    <fixVersion>2.6.0-rc0</fixVersion>
                                    <component>Geo</component>
                    <component>Index Maintenance</component>
                                        <votes>2</votes>
                                    <watches>12</watches>
                                                                                                                <comments>
                            <comment id="502099" author="xgen-internal-githook" created="Thu, 20 Feb 2014 02:38:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;hkhalsa&apos;, u&apos;name&apos;: u&apos;Hari Khalsa&apos;, u&apos;email&apos;: u&apos;hkhalsa@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9639&quot; title=&quot;2dsphere indexes with {2dsphereIndexVersion:2} should be sparse on geo fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9639&quot;&gt;&lt;del&gt;SERVER-9639&lt;/del&gt;&lt;/a&gt; For 2dsphere V2 indices don&apos;t index any docs missing any geo fields&lt;/p&gt;

&lt;p&gt;This reverts commit 3b5b35c15690769df2a11a75a3c6e6afd7c2169a.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/269c683220692299b5fb9cf431359e3ec299f8fc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/269c683220692299b5fb9cf431359e3ec299f8fc&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="500022" author="jhn" created="Sun, 16 Feb 2014 19:47:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dan%4010gen.com&quot; class=&quot;user-hover&quot; rel=&quot;dan@10gen.com&quot;&gt;dan@10gen.com&lt;/a&gt;, is it possible to resolve this issue with the new 2dsphere index version tag?&lt;/p&gt;

&lt;p&gt;See: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12175&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-12175&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="477384" author="pascal-bach" created="Sun, 5 Jan 2014 21:41:49 +0000"  >&lt;p&gt;I got that, I just wanted to make sure if this gets implemented in a later version it also works with empty arrays.&lt;/p&gt;

&lt;p&gt;On the other hand. Is there an alternative solution that allows indexing coordinates that are optional?&lt;/p&gt;

&lt;p&gt;For the moment I use legacy 2d indexes but I would really like to use the 2dspehre index.&lt;/p&gt;</comment>
                            <comment id="476746" author="dan@10gen.com" created="Fri, 3 Jan 2014 05:01:39 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pascal-bach&quot; class=&quot;user-hover&quot; rel=&quot;pascal-bach&quot;&gt;pascal-bach&lt;/a&gt;, the behavior for 2.6 will be unchanged from the behavior in 2.4.&lt;/p&gt;</comment>
                            <comment id="476672" author="pascal-bach" created="Thu, 2 Jan 2014 23:27:21 +0000"  >&lt;p&gt;Will this also work if the coordinates field is an empty array?&lt;br/&gt;
Mongoose for example by default creates empty arrays, they should behave the same way as a null value I suggest.&lt;/p&gt;</comment>
                            <comment id="474076" author="dan@10gen.com" created="Sat, 21 Dec 2013 16:03:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;hkhalsa&apos;, u&apos;name&apos;: u&apos;Hari Khalsa&apos;, u&apos;email&apos;: u&apos;hkhalsa@10gen.com&apos;}
&lt;p&gt;Message: 2dsphere can&apos;t be sparse now since it coulnd&apos;t be sparse in 2.4&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3b5b35c15690769df2a11a75a3c6e6afd7c2169a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3b5b35c15690769df2a11a75a3c6e6afd7c2169a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="474075" author="dan@10gen.com" created="Sat, 21 Dec 2013 16:00:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jhn&quot; class=&quot;user-hover&quot; rel=&quot;jhn&quot;&gt;jhn&lt;/a&gt;, We are going to have to revert to the current 2.4 behavior, which means 2dsphere indexes are &lt;b&gt;not&lt;/b&gt; sparse by default and ignore the sparse option.  In a future version of the server, we will have to bump the version of the index to account for this.&lt;/p&gt;</comment>
                            <comment id="473990" author="jhn" created="Fri, 20 Dec 2013 22:24:48 +0000"  >&lt;p&gt;Dan, do you have any indication on if/how this is going to be resolved? Is it skipped entirely for 2.6?&lt;/p&gt;</comment>
                            <comment id="473488" author="dan@10gen.com" created="Fri, 20 Dec 2013 00:42:45 +0000"  >&lt;p&gt;The fix for this needs to be reverted before 2.6.  The reason being is that you cannot upgrade a 2.4 server to 2.6 where the 2dsphere index was created with {sparse:true}.  Namely, If a document without the geo field set is deleted with a 2.6 server which was indexed in 2.4, it will leave the index record in the index causing corruption.&lt;/p&gt;</comment>
                            <comment id="427013" author="tim0306" created="Tue, 17 Sep 2013 11:08:45 +0000"  >&lt;p&gt;Note this now works for collections in which entries with a location field are combined with entries where the location field is missing. However, in some of the duplicate posts this bug was reported as not being able to handle null values for the location field. Using null values still results in an error. Ideally an entry is not included in the index when the location field is missing or the location field or its coordinate subfield is null.&lt;/p&gt;</comment>
                            <comment id="373569" author="jhn" created="Wed, 3 Jul 2013 18:07:57 +0000"  >&lt;p&gt;Thanks for the fix Hari!&lt;/p&gt;</comment>
                            <comment id="373524" author="hari.khalsa@10gen.com" created="Wed, 3 Jul 2013 17:04:22 +0000"  >&lt;p&gt;I just submitted a change to that makes 2dsphere sparse by default, like 2d.  My apologies for the oversight.&lt;/p&gt;</comment>
                            <comment id="373522" author="auto" created="Wed, 3 Jul 2013 17:03:09 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;hkhalsa&apos;, u&apos;name&apos;: u&apos;Hari Khalsa&apos;, u&apos;email&apos;: u&apos;hkhalsa@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9639&quot; title=&quot;2dsphere indexes with {2dsphereIndexVersion:2} should be sparse on geo fields&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9639&quot;&gt;&lt;del&gt;SERVER-9639&lt;/del&gt;&lt;/a&gt; make 2dsphere indices sparse w.r.t. the indexed geo fields&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3457954bb082d98dfd769d27771d4e30f3f785a5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3457954bb082d98dfd769d27771d4e30f3f785a5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="370294" author="apocryphalauthor@gmail.com" created="Fri, 28 Jun 2013 19:42:13 +0000"  >&lt;p&gt;I would like to &quot;+1&quot; here.  We&apos;re switching to a 2dsphere index for faster geospacial queries, but a small portion of our data is incomplete (i.e. we don&apos;t have the lat/lon data).  It would be nice if these were skipped in the index, instead of the whole index refusing the build.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="88973">SERVER-10709</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="78917">SERVER-9926</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="81190">SERVER-10095</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="93933">SERVER-11149</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>14.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 28 Jun 2013 19:42:13 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10249"><![CDATA[Cannot]]></customfieldvalue>

                        </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>auto</customfieldvalue>
            <customfieldvalue>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>hari.khalsa@10gen.com</customfieldvalue>
            <customfieldvalue>jhn</customfieldvalue>
            <customfieldvalue>pascal-bach</customfieldvalue>
            <customfieldvalue>apocryphalauthor@gmail.com</customfieldvalue>
            <customfieldvalue>tim0306</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmton:</customfieldvalue>

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

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

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