<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:40:35 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>[COMPASS-5721] Query for sharded findAndModify must contain the shard key</title>
                <link>https://jira.mongodb.org/browse/COMPASS-5721</link>
                <project id="13182" key="COMPASS">Compass </project>
                    <description>&lt;h3&gt;&lt;a name=&quot;ProblemStatement%2FRationale&quot;&gt;&lt;/a&gt;&lt;b&gt;Problem Statement/Rationale&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;font color=&quot;#505f79&quot;&gt;I insert a document in a sharded collection using nodejs driver. I can update it using nodejs driver. I can&apos;t update it using compass gui.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#505f79&quot;&gt;I get the error &quot;Query for sharded findAndModify must contain the shard key&quot;. But the record does contain the shard key and everything is valid. I don&apos;t know which query compass is sending, but it seems erratic.&lt;/font&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;StepstoReproduce&quot;&gt;&lt;/a&gt;&lt;b&gt;Steps to Reproduce&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;font color=&quot;#505f79&quot;&gt;I don&apos;t know. Maybe a simple sharded collection, sharded with method HASHED.&lt;/font&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;ExpectedResults&quot;&gt;&lt;/a&gt;&lt;b&gt;Expected Results&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;font color=&quot;#505f79&quot;&gt;It should update.&lt;/font&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;ActualResults&quot;&gt;&lt;/a&gt;&lt;b&gt;Actual Results&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;font color=&quot;#505f79&quot;&gt;Update is denied with the error &quot;Query for sharded findAndModify must contain the shard key&quot;.&lt;/font&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;AdditionalNotes&quot;&gt;&lt;/a&gt;&lt;b&gt;Additional Notes&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;font color=&quot;#505f79&quot;&gt;Please see the screenshots. The collection &quot;appointment&quot; is sharded on &quot;_where._location._country._locId&quot; with the method &quot;HASHED&quot;. It should work.&lt;/font&gt;&lt;/p&gt;</description>
                <environment>Windows 10</environment>
        <key id="2023002">COMPASS-5721</key>
            <summary>Query for sharded findAndModify must contain the shard key</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="13203">Gone away</resolution>
                                        <assignee username="leroux.bodenstein@mongodb.com">Le Roux Bodenstein</assignee>
                                    <reporter username="bonjourjoel@gmail.com">Joel J</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Apr 2022 11:13:44 +0000</created>
                <updated>Fri, 27 Oct 2023 20:18:45 +0000</updated>
                            <resolved>Mon, 20 Jun 2022 10:39:13 +0000</resolved>
                                    <version>1.31.1</version>
                    <version>1.31.2</version>
                                    <fixVersion>No version</fixVersion>
                                    <component>Compass</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4616975" author="JIRAUSER1263778" created="Wed, 15 Jun 2022 10:11:51 +0000"  >&lt;p&gt;I see. One possibility is that the bug is fixed is the current version. A lot of releases have been made in the last weeks. Maybe something has fixed this...&lt;/p&gt;

&lt;p&gt;I don&apos;t have the bug any more.&lt;/p&gt;</comment>
                            <comment id="4616876" author="JIRAUSER1261456" created="Wed, 15 Jun 2022 09:15:36 +0000"  >&lt;p&gt;I did my testing by sharding with HASH. Hard to see why the method would matter, though - the code that loads the shard keys and passes them along when updating doesn&apos;t care about that detail. My hunch was that it was something to do with the deeply nested path to the key, but haven&apos;t been able to reproduce anything there yet.&lt;/p&gt;</comment>
                            <comment id="4616425" author="JIRAUSER1263778" created="Wed, 15 Jun 2022 02:49:44 +0000"  >&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;Unfortunately, I don&apos;t have the configuration any more. And I can&apos;t provide this log. Sorry.&lt;/p&gt;

&lt;p&gt;This issue was submitted 2 months ago, and I had to find a workaround. I sharded the collection with method RANGE instead of HASH, and the bug disappeared.&lt;/p&gt;

&lt;p&gt;In your test, do you shard the table with the method HASH? Because it may be the trigger of the bug.&lt;/p&gt;

&lt;p&gt;Regards.&lt;/p&gt;</comment>
                            <comment id="4614144" author="JIRAUSER1261456" created="Tue, 14 Jun 2022 13:02:44 +0000"  >&lt;p&gt;Thank you for filing this issue. We do support updating docs with the shard key and it is supposed to just work automatically. I just tried to recreate this and all my tests so far have worked just fine. I&apos;m thinking there might be some edge case here unique to your situation.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The code that loads the shard keys so we can make sure those get included does log a warning if it fails, so if you can send us your &lt;a href=&quot;https://www.mongodb.com/docs/compass/current/troubleshooting/logs/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;compass log file&lt;/a&gt; we might be able to spot something in there to help us reproduce this issue.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="372614" name="bug_mongodb_compass_must_contain_shard_key_1.png" size="120441" author="bonjourjoel@gmail.com" created="Tue, 12 Apr 2022 11:13:21 +0000"/>
                            <attachment id="372613" name="bug_mongodb_compass_must_contain_shard_key_2.png" size="157176" author="bonjourjoel@gmail.com" created="Tue, 12 Apr 2022 11:13:24 +0000"/>
                            <attachment id="372612" name="bug_mongodb_compass_must_contain_shard_key_3.png" size="126494" author="bonjourjoel@gmail.com" created="Tue, 12 Apr 2022 11:13:27 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5006R00001l9uMUQAY, 5006R00001mETdAQAW]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 16 May 2022 19:32:35 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 34 weeks 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_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 34 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>bonjourjoel@gmail.com</customfieldvalue>
            <customfieldvalue>leroux.bodenstein@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0qukf:</customfieldvalue>

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

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