<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:00:45 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-10517] Documentation on Unique Key for Sharded Cluster wrong</title>
                <link>https://jira.mongodb.org/browse/DOCS-10517</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;The first sentence on unique keys for sharded clusters on this &lt;a href=&quot;https://docs.mongodb.com/manual/core/sharding-shard-key/#unique-indexes&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;link&lt;/a&gt; says this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For a sharded collection, only the _id field index and the index on the shard key or a compound index where the shard key is a prefix can be unique&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This implies to me that the _id field can be unique across the cluster AND the shard key can be unique as well.&lt;/p&gt;

&lt;p&gt;Which is wrong. Within a particular shard _id can be unique. But the only index that can be truly unique across the cluster either has to be the shard key or a index that has the shard key as a prefix. We&apos;re actually depending/hoping that the _id on its own is unique without enforcing uniqueness (i.e. ObjectID is usually reliably unique).&lt;/p&gt;

&lt;p&gt;I would rewrite this as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For a sharded collection, only the index on the shard key or a compound index where the shard key is a prefix can be unique.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;And add a &lt;b&gt;warning&lt;/b&gt; somewhere below that specifically states that the _id can only be unique across the sharded cluster if and only if its the shard key and that when generating _id values that ObjectID or something suitably unique should be used as well.&lt;/p&gt;

&lt;p&gt;Roy&lt;/p&gt;</description>
                <environment></environment>
        <key id="403276">DOCS-10517</key>
            <summary>Documentation on Unique Key for Sharded Cluster wrong</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="13201">Fixed</resolution>
                                        <assignee username="kay.kim@mongodb.com">Kay Kim</assignee>
                                    <reporter username="roy.rim@mongodb.com">Roy Rim</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Jul 2017 20:30:16 +0000</created>
                <updated>Mon, 30 Oct 2023 21:08:58 +0000</updated>
                            <resolved>Mon, 3 Dec 2018 17:42:16 +0000</resolved>
                                                    <fixVersion>Server_Docs_20231030</fixVersion>
                                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2078708" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:47:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: tweak - bold the word not&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/b20506b9b1a6bfaa1a606686e44e488905ac5f52&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/b20506b9b1a6bfaa1a606686e44e488905ac5f52&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078706" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:47:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: tweak - bold the word not&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/056895e35665f113a9885bb06ed9f9ef24f3c6e0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/056895e35665f113a9885bb06ed9f9ef24f3c6e0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078704" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:46:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: tweak - bold the word not&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/6174185c5a4b2e77f77a759aa9ce1dcd7338836e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/6174185c5a4b2e77f77a759aa9ce1dcd7338836e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078702" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:46:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: tweak - bold the word not&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/c3814ac6a27b058831e979ec55d6088dcb500b02&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/c3814ac6a27b058831e979ec55d6088dcb500b02&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078701" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:45:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: tweak - bold the word not&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/eed67f2b838856659cbdc0df8b969c30aef98048&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/eed67f2b838856659cbdc0df8b969c30aef98048&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078652" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:17:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: unique index and shard keys&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/91efa8f1a2ccb6fb0fddddc5f01ab5f2d1a0b14b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/91efa8f1a2ccb6fb0fddddc5f01ab5f2d1a0b14b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078649" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:16:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: unique index and shard keys&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/0f0808c2df4e0f35e509193a12a85d753ab7ae78&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/0f0808c2df4e0f35e509193a12a85d753ab7ae78&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078648" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:16:16 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: unique index and shard keys&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/66135c5fbc722cb571ad834243bfb00b9cdc685c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/66135c5fbc722cb571ad834243bfb00b9cdc685c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078645" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:13:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: unique index and shard keys&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/cb0d75af037797c55ca681d207f8e619bfc980e6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/cb0d75af037797c55ca681d207f8e619bfc980e6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2078644" author="xgen-internal-githook" created="Mon, 3 Dec 2018 17:12:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kay Kim&apos;, &apos;email&apos;: &apos;kay.kim@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10517&quot; title=&quot;Documentation on Unique Key for Sharded Cluster wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10517&quot;&gt;&lt;del&gt;DOCS-10517&lt;/del&gt;&lt;/a&gt;: unique index and shard keys&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/22aa21a9e9b69404df74b4a6f40b819e966f2106&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/22aa21a9e9b69404df74b4a6f40b819e966f2106&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1776204" author="brian.moss" created="Wed, 17 Jan 2018 06:29:58 +0000"  >&lt;p&gt;PR: &lt;a href=&quot;https://github.com/mongodb/docs/pull/3197&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/pull/3197&lt;/a&gt;&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>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 12 Jul 2017 22:41:02 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 10 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>brian.moss@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kay.kim@mongodb.com</customfieldvalue>
            <customfieldvalue>roy.rim@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htasav:</customfieldvalue>

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

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