<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:23:14 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>[DRIVERS-1340] Allow hint for unacknowledged writes using OP_MSG when supported by the server</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-1340</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;p&gt;This reverts DRIVERS-991, which instructed drivers to raise a client-side error when the &lt;tt&gt;hint&lt;/tt&gt; option is provided with an unacknowledged write issued against any server version.&lt;/p&gt;

&lt;p&gt;When the the server is known to support &lt;tt&gt;hint&lt;/tt&gt; (i.e. 4.2+ for update, 4.4+ for delete), drivers should allow the option to be specified. They should only report an error for earlier server versions where the server is known to &lt;b&gt;not&lt;/b&gt; support the option and an error would otherwise not be returned because of the nature of unacknowledged writes.&lt;/p&gt;

&lt;p&gt;Previous arguments relating &lt;tt&gt;hint&lt;/tt&gt; to existing treatment of &lt;tt&gt;arrayFilters&lt;/tt&gt; and &lt;tt&gt;collation&lt;/tt&gt; aren&apos;t relevant, because their documentation refers to &quot;unacknowledged writes using OP_UPDATE&quot; (where the option cannot be expressed). Those options don&apos;t refer to OP_MSG at all, because they were both supported by all server versions that support OP_MSG. &lt;tt&gt;hint&lt;/tt&gt; can retain the language about OP_UPDATE, but its OP_MSG language should be revised to only mandate an error on unsupported server versions.&lt;/p&gt;

&lt;p&gt;Lastly, the following &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#q-a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Q&amp;amp;A&lt;/a&gt; should be revised:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Q: Why are client-side errors raised when options are provided for unacknowledged write operations, even on server versions that support those options?&lt;br/&gt;
 Even if the server supports an option, that option could be incorrectly formatted or contain outdated information (e.g. a &quot;hint&quot; option referencing an index that no longer exists). This is a problem during unacknowledged writes because the server cannot return an error response to alert the client of an incorrect option. By always raising a client-side error when options are specified for unacknowledged writes, users are prevented from performing operations with options that do not work.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This is a poor argument as incorrectly formatted options can just as easily apply to the filter or update/replacement arguments (e.g. using an invalid query operator). It&apos;s one thing to raise a client-error when the driver knows for certain that a server option is not supported, but the current strategy is presumptive.&lt;/p&gt;

&lt;p&gt;We should also update the language for findAndModify in the CRUD spec (since it does refer to behavior of unacknowledged write concerns). findAndModify support for &lt;tt&gt;hint&lt;/tt&gt; requires 4.4+ (see: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42099&quot; title=&quot;allow passing hint to findAndModify for update operations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42099&quot;&gt;&lt;del&gt;SERVER-42099&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44367&quot; title=&quot;Allow hinting the delete command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44367&quot;&gt;&lt;del&gt;SERVER-44367&lt;/del&gt;&lt;/a&gt;). Although findAndModify always returns a response, an unacknowledged write concern seems to force an {{&lt;/p&gt;

{ok:1}

&lt;p&gt;}} response, which hides any error if &lt;tt&gt;hint&lt;/tt&gt; is unsupported or invalid (e.g. no such index). With respect to this issue, we need only concern ourselves with whether &lt;tt&gt;hint&lt;/tt&gt; is supported, so raising an error if &lt;tt&gt;hint&lt;/tt&gt; is used on a pre-4.4 server with an unacknowledged write concern is sufficient.&lt;/p&gt;
&lt;hr /&gt;
&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #fafbfc;&quot;&gt;
&lt;h3&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;This issue was originally reported after starting work on language tickets for DRIVERS-991, which asked drivers to raise client-side errors for any use of &lt;tt&gt;hint&lt;/tt&gt; with unacknowledged writes. This ticket seeks to revert that change and make an allowance for cases where drivers know that the server does support the &lt;tt&gt;hint&lt;/tt&gt; option. Since DRIVERS-991 was filed, libmongoc and dependent drivers have chosen not to implement that ticket and are instead waiting on this ticket to be resolved. This ticket has languished for more than a year since and remains outstanding.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;a name=&quot;Whoistheaffectedenduser%3F&quot;&gt;&lt;/a&gt;Who is the affected end user?&lt;/h4&gt;

&lt;p&gt;Applications that would like to utilize &lt;tt&gt;hint&lt;/tt&gt; options with unacknowledged writes.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howdoesthisaffecttheenduser%3F&quot;&gt;&lt;/a&gt;How does this affect the end user?&lt;/h4&gt;

&lt;p&gt;The behavior is currently prohibited by our specifications despite being possible to implement. In hindsight, it was premature to add the blanket prohibition.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howlikelyisitthatthisproblemorusecasewilloccur%3F&quot;&gt;&lt;/a&gt;How likely is it that this problem or use case will occur?&lt;/h4&gt;

&lt;p&gt;A minority of applications make individual use of &lt;tt&gt;hint&lt;/tt&gt; and unacknowledged writes. The intersection of applications using both features together is even rarer.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Iftheproblemdoesoccur%2Cwhataretheconsequencesandhowseverearethey%3F&quot;&gt;&lt;/a&gt;If the problem does occur, what are the consequences and how severe are they?&lt;/h4&gt;

&lt;p&gt;Inability to execute a supported operation.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisissueurgent%3F&quot;&gt;&lt;/a&gt;Is this issue urgent?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketrequiredbyadownstreamteam%3F&quot;&gt;&lt;/a&gt;Is this ticket required by a downstream team?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketonlyfortests%3F&quot;&gt;&lt;/a&gt;Is this ticket only for tests?&lt;/h4&gt;

&lt;p&gt;This ticket affects both driver functionality and our spec tests.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="1415036">DRIVERS-1340</key>
            <summary>Allow hint for unacknowledged writes using OP_MSG when supported by the server</summary>
                <type id="14901" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14700&amp;avatarType=issuetype">Spec Change</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="13453" iconUrl="https://jira.mongodb.org/images/icons/status_generic.gif" description="">Implementing</status>
                    <statusCategory id="4" key="indeterminate" colorName="inprogress"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                            <label>leads-triage</label>
                    </labels>
                <created>Mon, 20 Jul 2020 19:00:34 +0000</created>
                <updated>Wed, 22 Jun 2022 20:54:29 +0000</updated>
                                                                <component>CRUD</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4232725" author="jmikola@gmail.com" created="Mon, 6 Dec 2021 17:05:52 +0000"  >&lt;p&gt;Documentation for the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/command/findAndModify/#value&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;value&lt;/tt&gt; result field&lt;/a&gt; only talks about &lt;tt&gt;null&lt;/tt&gt; and document values. It does not mention that the &lt;tt&gt;value&lt;/tt&gt; field will be entirely omitted if &lt;tt&gt;findAndModify&lt;/tt&gt; specifies an unacknowledged write concern, as shown below:&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;&amp;gt; db.foo.drop()&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;false&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;&amp;gt; db.foo.insertOne({x:1})&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;{&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;acknowledged&quot; : true,&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;insertedId&quot; : ObjectId(&quot;61ae3844a4b363eaef266d3d&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;}&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;&amp;gt; db.runCommand({findAndModify:&quot;foo&quot;,query:{x:1},update:{$inc:{y:1}},new:true,writeConcern:{w:0}})&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;ok&quot; : 1 }&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;&amp;gt; db.foo.findOne()&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;61ae3844a4b363eaef266d3d&quot;), &quot;x&quot; : 1, &quot;y&quot; : 1 }&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;&amp;gt; db.runCommand({findAndModify:&quot;foo&quot;,query:{x:1},update:{$inc:{y:1}},new:false,writeConcern:{w:0}})&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;ok&quot; : 1 }&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;&amp;gt; db.foo.findOne()&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;61ae3844a4b363eaef266d3d&quot;), &quot;x&quot; : 1, &quot;y&quot; : 2 }&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;I&apos;ll note that the CRUD spec currently documents the return value of &lt;tt&gt;findAndModify&lt;/tt&gt; helpers as &quot;Document&quot; and doesn&apos;t seem to discuss a possible &lt;tt&gt;null&lt;/tt&gt; return value at all. SPEC-148 is an old ticket that talked about that inconsistency and claims to have addressed it but it&apos;s not cross-referenced with any commit that I could find.&lt;/p&gt;

&lt;p&gt;As far as handling non-existent results (i.e. &lt;tt&gt;value&lt;/tt&gt; is omitted instead of being &lt;tt&gt;null&lt;/tt&gt;), I created &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1899&quot; title=&quot;Write results should be optional to accommodate unacknowledged write concerns&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1899&quot;&gt;&lt;del&gt;DRIVERS-1899&lt;/del&gt;&lt;/a&gt; while working on this issue (&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1340&quot; title=&quot;Allow hint for unacknowledged writes using OP_MSG when supported by the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1340&quot;&gt;DRIVERS-1340&lt;/a&gt;) to propose that we use &quot;Optional&amp;lt;&amp;gt;&quot; syntax for all results of CRUD methods that might utilize an unacknowledged write concern. That would only entail changes to the spec itself (not tests), which is why I used &lt;tt&gt;$$unsetOrMatches&lt;/tt&gt; in the existing tests for &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1340&quot; title=&quot;Allow hint for unacknowledged writes using OP_MSG when supported by the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1340&quot;&gt;DRIVERS-1340&lt;/a&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
&lt;p&gt;I expect many drivers to fail this assertion because it would require that the moreToCome bit is set for the message (or the response is dropped by the driver itself). But it&apos;s not clear that is the correct behavior. Consider that:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;findAndModify is a query, so a result is expected by the application, as with any other query.&lt;/li&gt;
	&lt;li&gt;findAndModify can return null for the (possibly) modified document, and it would be odd if that could mean both that no document was modified or that a document was possibly modified but the write was unacknowledged.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;As one reference, the Java driver&apos;s current behavior is the following:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;If the write concern is unacknowledged and hint is specified, an exception is thrown.&lt;/li&gt;
	&lt;li&gt;If the write concern is unacknowledged, the write concern is not included in the findAndModify command, and the moreToCome bit remains unset.&lt;/li&gt;
	&lt;li&gt;If the write concern is set and is not unacknowledged, it&apos;s included in the findAndModify command.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;I&apos;m not aware of any guidance that drivers set &lt;tt&gt;moreToCome&lt;/tt&gt; for &lt;tt&gt;findAndModify&lt;/tt&gt; commands. With respect to unacknowledged write concerns, I&apos;ve only seen &lt;tt&gt;moreToCome&lt;/tt&gt; used with the &lt;tt&gt;insert&lt;/tt&gt;, &lt;tt&gt;update&lt;/tt&gt;, and &lt;tt&gt;delete&lt;/tt&gt; commands. Like most other commands, &lt;tt&gt;findAndModify&lt;/tt&gt; always returns a result (even if just {&lt;tt&gt;ok:1&lt;/tt&gt;}).&lt;/p&gt;

&lt;p&gt;The CRUD spec itself never addresses the wire protocol for the underlying commands, which is why I didn&apos;t bother to talk about this in the spec changes associated with this ticket.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;My recommendation is to specify as standard the latter two behaviors, and entirely remove any restrictions on use of hint with unacknowledged write concern, since that write concern will be ignored according to the latter two behaviors.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I think it&apos;s still sensible to prohibit &lt;tt&gt;hint&lt;/tt&gt; and {&lt;tt&gt;w:0&lt;/tt&gt;} when we know &lt;tt&gt;hint&lt;/tt&gt; is unsupported. This was originally requested as a safeguard for users since they might otherwise never realize their command failed to execute, and the purpose of this issue was simply to relax that restriction when drivers know that &lt;tt&gt;hint&lt;/tt&gt; &lt;em&gt;is&lt;/em&gt; supported by the server.&lt;/p&gt;

&lt;p&gt;With all that said, I&apos;m failing to see how &lt;tt&gt;$$unsetOrMatches&lt;/tt&gt; would be problematic for drivers. Whether a driver decides to return &lt;tt&gt;null&lt;/tt&gt; or nothing at all (for languages that make such a distinction), that assertion should be satisfied.&lt;/p&gt;</comment>
                            <comment id="4031404" author="xgen-internal-githook" created="Tue, 31 Aug 2021 14:25:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1340&quot; title=&quot;Allow hint for unacknowledged writes using OP_MSG when supported by the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1340&quot;&gt;DRIVERS-1340&lt;/a&gt;: Allow w:0 and hint if supported by server (#1057)&lt;/p&gt;

&lt;p&gt;update supports hint on 4.2+. delete and findAndModify support hint on 4.4+.&lt;/p&gt;

&lt;p&gt;Add APM assertions for successful commands to ensure that w:0 is actually used.&lt;/p&gt;

&lt;p&gt;Co-authored-by: Benjamin Rewis &amp;lt;32186188+benjirewis@users.noreply.github.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/specifications/commit/59a5dadb2eeab8bba5a7d9a9acd47aa8c1d594cf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/commit/59a5dadb2eeab8bba5a7d9a9acd47aa8c1d594cf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4024857" author="jmikola@gmail.com" created="Thu, 26 Aug 2021 18:04:29 +0000"  >&lt;p&gt;Cross-referencing with the related tickets for introducing support for &lt;tt&gt;hint&lt;/tt&gt; on update, delete, and findAndModify comands. The spec tests for this issue will depend on those features being implemented, so it makes sense to model this as an issue dependency.&lt;/p&gt;</comment>
                            <comment id="4024591" author="jmikola@gmail.com" created="Thu, 26 Aug 2021 16:28:01 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/specifications/pull/1057&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/pull/1057&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="808651">DRIVERS-681</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="971317">DRIVERS-751</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="1848967">NODE-3541</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848966">JAVA-4275</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848970">PHPLIB-712</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848964">CSHARP-3791</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848965">GODRIVER-2125</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848962">CDRIVER-4127</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848963">CXX-2347</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848968">MOTOR-806</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848969">PYTHON-2863</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848971">RUBY-2766</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1848972">RUST-974</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1860822">DRIVERS-1899</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1089967">DRIVERS-790</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                            <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Drivers should no longer prohibit using &lt;tt&gt;hint&lt;/tt&gt; with an unacknowledged write concern for update, delete, and findAndModify commands (issued via OP_MSG) and related helpers (e.g. UpdateOne, bulkWrite, findOneAndDelete) if &lt;tt&gt;hint&lt;/tt&gt; is known to be supported by the server executing the operation (i.e. 4.2+ for update commands, 4.4+ for delete and findAndModify). Drivers should sync unified CRUD tests with &lt;a href=&quot;https://github.com/mongodb/specifications/commit/59a5dadb2eeab8bba5a7d9a9acd47aa8c1d594cf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/specifications@59a5dad&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drivers (like Java, for example) that ignore unacknowledged write concern for findOneAndReplace/Update/Delete helpers should skip the following tests:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Unacknowledged findOneAndReplace with hint string on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndReplace with hint document on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndUpdate with hint string on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndUpdate with hint document on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndDelete with hint string on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndDelete with hint document on 4.4+ server&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;because those tests are assuming that the driver includes writeConcern: {w : 0 } in the &lt;tt&gt;findAndModify&lt;/tt&gt; command and that, as a result, the server response with only &lt;tt&gt;ok: 1&lt;/tt&gt; and therefore &lt;tt&gt;value&lt;/tt&gt; is unset.&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10951" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Driver Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10748"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_23952" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Driver Compliance</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<style type='text/css'>
         #scriptField, #scriptField *{
                border: 1px solid black;
            }

            #scriptField{
                border-collapse: collapse;
            }

            #scriptField td {
                text-align: center; /* Center-align text in table cells */
            }

            #scriptField td.key {
                text-align: left; /* Left-align text in the Key column */
            }

            #scriptField a {
                text-decoration: none; /* Remove underlines from links */
                border: none; /* Remove border from links */
            }
            
            /* Add green background color to cells with FixVersion */
            #scriptField td.hasFixVersion {
                background-color: #00FF00; /* Green color code */
            }

            /* Center-align the first row headers */
            #scriptField th {
                text-align: center;
            }
        </style>
<table id='scriptField'>
  <tr>
    <th>Key</th>
    <th>Status/Resolution</th>
    <th>FixVersion</th>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-4127'>CDRIVER-4127</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.22.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CXX-2347'>CXX-2347</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>3.7.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-3791'>CSHARP-3791</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/GODRIVER-2125'>GODRIVER-2125</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-4275'>JAVA-4275</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>4.5.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/NODE-3541'>NODE-3541</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/MOTOR-806'>MOTOR-806</a>
    </td>
    <td>Duplicate</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-2863'>PYTHON-2863</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>4.1</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPLIB-712'>PHPLIB-712</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.10.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-2766'>RUBY-2766</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.18.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUST-974'>RUST-974</a>
    </td>
    <td>Duplicate</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/SWIFT-1304'>SWIFT-1304</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.4.0</td>
  </tr>
</table>]]></customfieldvalue>


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