<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:15:06 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-16308] Investigate changes in SERVER-44422: Allow findAndModify and delete one to target by query instead of extracted shard key</title>
                <link>https://jira.mongodb.org/browse/DOCS-16308</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #c2d2c2;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;background-color: #239eb0;&quot;&gt;&lt;b&gt;Original Downstream Change Summary&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Documentation for 6.0 and 5.0 will need to be updated to no longer say that you need an equality on the full shard key to perform findAndModify or deleteOne. You can now perform a findAndModify and deleteOne with a partial shard key in the query as long as only one shard is targeted.&lt;/p&gt;

&lt;p&gt;For example: if the shard key was {a: 1, b: 1}. Then previously a query such as findAndModify({a: 3}, {$set: {c: 10}}) would fail because the full shard key was not in the query. With the changes made in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44422&quot; title=&quot;Allow findAndModify and delete one to target by query instead of extracted shard key&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44422&quot;&gt;&lt;del&gt;SERVER-44422&lt;/del&gt;&lt;/a&gt; the findAndModify no longer fails as long as only one shard is targeted.&lt;/p&gt;
&lt;h2&gt;&lt;a name=&quot;DescriptionofLinkedTicket&quot;&gt;&lt;/a&gt;Description of Linked Ticket&lt;/h2&gt;

&lt;p&gt;findAndModify and delete with justOne=true must be targeted to a single shard which they check by extracting a shard key from their query and targeting the chunk that owns that key. This is done through &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c5586f6b8da6fd37abf76994cc796afa23d2b7b6/src/mongo/s/shard_key_pattern.h#L187-L189&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardKeyPattern::extractShardKeyFromQuery()&lt;/a&gt; which requires a simple query that will exactly match some value, e.g. {skey: 5} or {skey; {$eq: 5}}. More complex queries that don&apos;t produce an exact match, but can still be targeted to a single shard are currently rejected.&lt;/p&gt;

&lt;p&gt;This could be improved by changing findAndModify and delete to target using &lt;a href=&quot;https://github.com/mongodb/mongo/blob/da5b6eff05c710029994ae1e06b47d1974974f6c/src/mongo/s/chunk_manager.h&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ChunkManager::getShardIdsForQuery()&lt;/a&gt;, which returns the shards that own ranges that overlap with the shard key index bounds generated by the query (after checking for an exact shard key match first), and throwing if more than one shard is targeted. This is already &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2e5391cb4ca41bb352507915b0fe24b142d61a29/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L486-L489&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;how an update is targeted by its query&#160;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2412196">DOCS-16308</key>
            <summary>Investigate changes in SERVER-44422: Allow findAndModify and delete one to target by query instead of extracted shard key</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="jocelyn.mendez@mongodb.com">Jocelyn Mendez</assignee>
                                    <reporter username="backlog-server-pm">Backlog - Core Eng Program Management Team</reporter>
                        <labels>
                            <label>query</label>
                            <label>sharding</label>
                    </labels>
                <created>Tue, 8 Aug 2023 17:32:04 +0000</created>
                <updated>Mon, 13 Nov 2023 17:30:20 +0000</updated>
                            <resolved>Wed, 4 Oct 2023 19:42:22 +0000</resolved>
                                                    <fixVersion>7.1.0-rc0</fixVersion>
                    <fixVersion>5.0.20</fixVersion>
                    <fixVersion>6.0.9</fixVersion>
                    <fixVersion>7.0.2</fixVersion>
                    <fixVersion>Server_Docs_20231030</fixVersion>
                    <fixVersion>Server_Docs_20231106</fixVersion>
                    <fixVersion>Server_Docs_20231105</fixVersion>
                    <fixVersion>Server_Docs_20231113</fixVersion>
                                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                            <outwardlinks description="documents">
                                        <issuelink>
            <issuekey id="990012">SERVER-44422</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14258" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Baseline start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 26 Sep 2023 00:00:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 3 Oct 2023 18:02:48 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        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_14876" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Docs Reviewer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>kenneth.dyer@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Documentation for 6.0 and 5.0 will need to be updated to no longer say that you need the full shard key to perform findAndModify or deleteOne. You can now perform a findAndModify and deleteOne with a partial shard key in the query as long as only one shard is targeted. &lt;br/&gt;
&lt;br/&gt;
For example: if the shard key was {a: 1, b: 1}. Then previously a query such as findAndModify({a: 3}, {$set: {c: 10}}) would fail because the full shard key was not in the query. With the changes made in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44422&quot; title=&quot;Allow findAndModify and delete one to target by query instead of extracted shard key&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44422&quot;&gt;&lt;strike&gt;SERVER-44422&lt;/strike&gt;&lt;/a&gt; the findAndModify no longer fails as long as only one shard is targeted. </customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_14873" key="com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker">
                        <customfieldname>External Reviewer</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[wenqin.ye@mongodb.com]]></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>emet.ozar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            26 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-pm</customfieldvalue>
            <customfieldvalue>jocelyn.mendez@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2lejr:</customfieldvalue>

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

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