<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:54:34 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>[DOCS-7579] Comment on: &quot;manual/core/index-sparse.txt&quot;</title>
                <link>https://jira.mongodb.org/browse/DOCS-7579</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;The final statement on this page appears to be wrong:&lt;/p&gt;

&lt;p&gt;```&lt;br/&gt;
However, this index would not permit adding the following documents:&lt;/p&gt;

&lt;p&gt;db.scores.insert( &lt;/p&gt;
{ &quot;userid&quot;: &quot;PWWfO8lFs1&quot;, &quot;score&quot;: 82 }
&lt;p&gt; )&lt;br/&gt;
db.scores.insert( &lt;/p&gt;
{ &quot;userid&quot;: &quot;XlSOX66gEy&quot;, &quot;score&quot;: 90 }
&lt;p&gt; )&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;It would allow those documents because their score value is unique.  I think you accidentally set the userid&apos;s to be similar to past inserted data rather than the scores.  I tested this simply by entering the commands:&lt;/p&gt;

&lt;p&gt;```&lt;br/&gt;
&amp;gt; db.scores.ensureIndex( &lt;/p&gt;
{ score: 1 }
&lt;p&gt; , &lt;/p&gt;
{ sparse: true, unique: true }
&lt;p&gt; )&lt;/p&gt;
{
	&quot;createdCollectionAutomatically&quot; : true,
	&quot;numIndexesBefore&quot; : 1,
	&quot;numIndexesAfter&quot; : 2,
	&quot;ok&quot; : 1
}
&lt;p&gt;&amp;gt; db.scores.insert( &lt;/p&gt;
{ &quot;userid&quot;: &quot;PWWfO8lFs1&quot;, &quot;score&quot;: 43 }
&lt;p&gt; )&lt;br/&gt;
WriteResult(&lt;/p&gt;
{ &quot;nInserted&quot; : 1 }
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.scores.insert( &lt;/p&gt;
{ &quot;userid&quot;: &quot;XlSOX66gEy&quot;, &quot;score&quot;: 34 }
&lt;p&gt; )&lt;br/&gt;
WriteResult(&lt;/p&gt;
{ &quot;nInserted&quot; : 1 }
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.scores.insert( &lt;/p&gt;
{ &quot;userid&quot;: &quot;nuZHu2tcRm&quot; }
&lt;p&gt; )&lt;br/&gt;
WriteResult(&lt;/p&gt;
{ &quot;nInserted&quot; : 1 }
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.scores.insert( &lt;/p&gt;
{ &quot;userid&quot;: &quot;HIGvEZfdc5&quot; }
&lt;p&gt; )&lt;br/&gt;
WriteResult(&lt;/p&gt;
{ &quot;nInserted&quot; : 1 }
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.scores.insert( &lt;/p&gt;
{ &quot;userid&quot;: &quot;PWWfO8lFs1&quot;, &quot;score&quot;: 82 }
&lt;p&gt; )&lt;br/&gt;
WriteResult(&lt;/p&gt;
{ &quot;nInserted&quot; : 1 }
&lt;p&gt;)&lt;br/&gt;
```&lt;/p&gt;
</description>
                <environment>&lt;br/&gt;
&lt;br/&gt;
*Location*: &lt;a href=&quot;https://docs.mongodb.org/v2.4/core/index-sparse/#index-type-sparse&quot;&gt;https://docs.mongodb.org/v2.4/core/index-sparse/#index-type-sparse&lt;/a&gt;&lt;br/&gt;
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36&lt;br/&gt;
*Referrer*: &lt;a href=&quot;https://docs.mongodb.org/v2.4/core/index-unique/&quot;&gt;https://docs.mongodb.org/v2.4/core/index-unique/&lt;/a&gt;&lt;br/&gt;
*Screen Resolution*: 2560 x 1440&lt;br/&gt;
*repo*: docs&lt;br/&gt;
*source*: core/index-sparse&lt;br/&gt;
</environment>
        <key id="277636">DOCS-7579</key>
            <summary>Comment on: &quot;manual/core/index-sparse.txt&quot;</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="xgen-internal-docs">Docs Collector User</reporter>
                        <labels>
                            <label>collector-298ba4e7</label>
                    </labels>
                <created>Tue, 5 Apr 2016 18:06:26 +0000</created>
                <updated>Fri, 3 Nov 2017 11:12:55 +0000</updated>
                            <resolved>Tue, 5 Apr 2016 18:27:44 +0000</resolved>
                                                    <fixVersion>01112017-cleanup</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1226556" author="allison.moore@10gen.com" created="Tue, 5 Apr 2016 18:18:21 +0000"  >&lt;p&gt;In that example, we first say:&lt;/p&gt;

&lt;p&gt;&quot;Consider a collection &lt;tt&gt;scores&lt;/tt&gt; that contains the following documents:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : ObjectId(&quot;523b6e32fb408eea0eec2647&quot;), &quot;userid&quot; : &quot;newbie&quot; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : ObjectId(&quot;523b6e61fb408eea0eec2648&quot;), &quot;userid&quot; : &quot;abby&quot;, &quot;score&quot; : 82 }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : ObjectId(&quot;523b6e6ffb408eea0eec2649&quot;), &quot;userid&quot; : &quot;nina&quot;, &quot;score&quot; : 90 }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;and then add the unique index on the &lt;tt&gt;score&lt;/tt&gt; field. &lt;/p&gt;

&lt;p&gt;When we then try to insert the two documents you reference, they&apos;d match the existing documents in the collection. Sorry for the confusion!&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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 5 Apr 2016 18:18:21 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 45 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>allison.moore@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-docs</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmvlj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsk4fz:</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_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrzis7:</customfieldvalue>

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