<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:06:33 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-4637] E11000 (duplicate key error) should return a list of duplicate keys and _ids in insert, bulk insert, and continue_on_error inserts.</title>
                <link>https://jira.mongodb.org/browse/SERVER-4637</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The current output is like this:&lt;/p&gt;

&lt;p&gt;{&quot;err&quot;=&amp;gt;&quot;E11000 duplicate key error index: ruby-test-db.test.$foo_1  dup key: { : 3 }&quot;, &quot;code&quot;: 11000, &quot;n&quot;: 0, &quot;connectionId&quot;: 58, &quot;ok&quot;: 1.0}&lt;/p&gt;

&lt;p&gt;Three problems:&lt;br/&gt;
1. The duplicate key is specified as part of a string.&lt;br/&gt;
2. Only the latest duplicate key is given. On a bulk insert with continue_on_error, we should get a list containing all duplicate keys found.&lt;br/&gt;
3. If we&apos;re given only the duplicate keys, it&apos;s hard to be sure which documents were inserted. For that, we also need the _ids of the documents that were rejected.&lt;/p&gt;

&lt;p&gt;Here&apos;s the ideal output:&lt;/p&gt;

&lt;p&gt;{&quot;err&quot;=&amp;gt;&quot;E11000 duplicate key error index: ruby-test-db.test.$foo_1  dup keys: &lt;span class=&quot;error&quot;&gt;&amp;#91;3, 4&amp;#93;&lt;/span&gt;&quot;, &lt;br/&gt;
 &quot;keys&quot;: &lt;span class=&quot;error&quot;&gt;&amp;#91;3, 4&amp;#93;&lt;/span&gt;, rejected_ids: &lt;span class=&quot;error&quot;&gt;&amp;#91;ObjectId(&amp;quot;4f071fbe935f46ab13686625&amp;quot;), ObjectId(&amp;quot;4f071fbe935f46ab13686627&amp;quot;)&amp;#93;&lt;/span&gt;,&lt;br/&gt;
 &quot;code&quot;: 11000, &quot;n&quot;: 0, &quot;connectionId&quot;: 58, &quot;ok&quot;: 1.0&lt;br/&gt;
}&lt;/p&gt;

</description>
                <environment></environment>
        <key id="27852">SERVER-4637</key>
            <summary>E11000 (duplicate key error) should return a list of duplicate keys and _ids in insert, bulk insert, and continue_on_error inserts.</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="1" iconUrl="https://jira.mongodb.org/images/icons/statuses/open.png" description="">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="michael.gargiulo@mongodb.com">Michael Gargiulo</assignee>
                                    <reporter username="kbanker">Kyle Banker</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Jan 2012 16:23:40 +0000</created>
                <updated>Thu, 14 Apr 2022 16:20:42 +0000</updated>
                                            <version>2.0.2</version>
                                                    <component>Index Maintenance</component>
                                        <votes>24</votes>
                                    <watches>19</watches>
                                                                                                                <comments>
                            <comment id="1648611" author="john.lilley@redpoint.net" created="Tue, 15 Aug 2017 15:14:29 +0000"  >&lt;p&gt;For the record, I&apos;m after this to disambiguate optimistic locking scenarios so that I can differentiate the expected unique-key exception from some other issue.&lt;/p&gt;</comment>
                            <comment id="1270842" author="skeggse" created="Sat, 21 May 2016 03:36:16 +0000"  >&lt;p&gt;Duplicate?&lt;/p&gt;</comment>
                            <comment id="218036" author="nyxtom" created="Tue, 18 Dec 2012 07:32:50 +0000"  >&lt;p&gt;Perhaps if you&apos;re using SafeMode.True and you do get a duplicate key from the mongosafeexception, instead of providing the last error in the duplicate id - the error could provide the entire list of ids there.&lt;/p&gt;</comment>
                            <comment id="90340" author="derick" created="Tue, 21 Feb 2012 10:36:26 +0000"  >&lt;p&gt;Maybe a better output would be to group the key value and the accompanying objectID so you can link them together?&lt;/p&gt;</comment>
                            <comment id="78160" author="kbanker" created="Fri, 6 Jan 2012 16:49:59 +0000"  >&lt;p&gt;@scott. Yes, we&apos;ll have to account for the no _id situation. I&apos;m sure there are a few ways to go about it.&lt;/p&gt;</comment>
                            <comment id="78150" author="scotthernandez" created="Fri, 6 Jan 2012 16:29:15 +0000"  >&lt;p&gt;What if there are no _id fields filled in from the client? They could be generated on the server depending on the ordering of events and that would be confusing to return, no?&lt;/p&gt;

&lt;p&gt;Also, we should return the count of documents rejected/included/etc. if we don&apos;t.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="24392">RUBY-356</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="214836">SERVER-19281</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="151083">SERVER-14801</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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000XNyDhIAL]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 6 Jan 2012 16:29:15 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 26 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>derick</customfieldvalue>
            <customfieldvalue>skeggse</customfieldvalue>
            <customfieldvalue>john.lilley@redpoint.net</customfieldvalue>
            <customfieldvalue>kbanker</customfieldvalue>
            <customfieldvalue>michael.gargiulo@mongodb.com</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
            <customfieldvalue>nyxtom</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrohi7:</customfieldvalue>

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

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

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