<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:18:56 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>[CDRIVER-3755] Provide an index creation helper</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3755</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2096&quot; title=&quot;Flexible index-creation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2096&quot;&gt;&lt;del&gt;CDRIVER-2096&lt;/del&gt;&lt;/a&gt; deprecated index creation helpers in favor of sending &lt;tt&gt;createIndexes&lt;/tt&gt; commands directly through generic command helpers. This is documented in the &lt;a href=&quot;http://mongoc.org/libmongoc/1.16.2/create-indexes.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Creating Indexes guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This adds some difficulty for users and wrapping drivers in terms of constructing the command and passing supported options.&lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;commitQuorum&lt;/tt&gt; option is particularly problematic. This option is only supported on 4.4+ servers, and has adverse side-effects on older servers. This is documented by &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3748&quot; title=&quot;Document that commitQuorum is not supported on pre-4.4 servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3748&quot;&gt;&lt;del&gt;CDRIVER-3748&lt;/del&gt;&lt;/a&gt; and the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/index-management.rst#q--a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Q&amp;amp;A of the index management spec&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Starting in 3.4, the server validates all options passed to the createIndexes command, but due to a bug in versions 4.2.0-4.2.5 of the server (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47193&quot; title=&quot;createIndexes command accepts &amp;quot;commitQuorum&amp;quot; option on 4.2 servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47193&quot;&gt;&lt;del&gt;SERVER-47193&lt;/del&gt;&lt;/a&gt;), specifying commitQuorum does not result in an error. The option is used internally by the server on those versions, and its value could have adverse effects on index builds. To prevent users from mistakenly specifying this option, drivers manually verify it is only sent to 4.4+ servers.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Since libmongoc does not provide an index creation helper, and generic command helpers should not be validating command specific options, this forces the user / wrapping driver to do this validation. In particular, this required additional server selection and wire version checking in the C++ driver&apos;s support of &lt;tt&gt;commitQuorum&lt;/tt&gt; (&lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1998&quot; title=&quot;&amp;#39;CommitQuorum&amp;#39; option support for &amp;#39;createIndexes&#8217; command on MongoDB 4.4&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1998&quot;&gt;&lt;del&gt;CXX-1998&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;This PR discussion has additional context and motivation: &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/662#discussion_r454365303&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/662#discussion_r454365303&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1412051">CDRIVER-3755</key>
            <summary>Provide an index creation helper</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="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="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                            <label>GnG</label>
                            <label>neweng</label>
                            <label>rp-track</label>
                    </labels>
                <created>Thu, 16 Jul 2020 13:17:37 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:40 +0000</updated>
                            <resolved>Wed, 14 Jun 2023 16:37:27 +0000</resolved>
                                                    <fixVersion>1.24.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5499160" author="xgen-internal-githook" created="Wed, 14 Jun 2023 16:37:13 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3755&quot; title=&quot;Provide an index creation helper&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3755&quot;&gt;&lt;del&gt;CDRIVER-3755&lt;/del&gt;&lt;/a&gt; Provide an index creation helper (#1303)&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;format mongoc-collection.c&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;add `mongoc_collection_create_indexes_with_opts`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;make `assert_match_bson` a macro&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Includes the caller&apos;s file and line number on error.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;fixup `hex_to_bin` helper&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;return NULL if `hex` is NULL&lt;/li&gt;
	&lt;li&gt;set `len` to 0 on error&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This fixes a possible crash if LOCAL_MASTERKEY is not set in the example.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;update legacy test runner to use `mongoc_collection_create_indexes_with_opts`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;use `mongoc_collection_create_indexes_with_opts` in `create_collection_with_encryptedFields`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;use `mongoc_collection_create_indexes_with_opts` in `operation_create_index`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;fix placement of `strlen`&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;`strlen` was called was before `to_encrypt.value.v_utf8.str` was assigned. This resulted in a `strlen` call with `NULL` argument.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;use `mongoc_collection_create_indexes_with_opts` in examples&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;add documentation page for `mongoc_collection_create_indexes_with_opts`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;update &quot;Creating Indexes&quot; guide&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;add file name to example error message&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Co-authored-by: vector-of-bool &amp;lt;vectorofbool@gmail.com&amp;gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;fix documented type of `models` to include `*`&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Co-authored-by: Ezra Chung &amp;lt;88335979+eramongodb@users.noreply.github.com&amp;gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;simplify error handling&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Co-authored-by: Ezra Chung &amp;lt;88335979+eramongodb@users.noreply.github.com&amp;gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;revise assert message&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Co-authored-by: Ezra Chung &amp;lt;88335979+eramongodb@users.noreply.github.com&amp;gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;use `mongoc_collection_create_indexes_with_opts` in more tests&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;rename FAIL to HANDLE_ERROR&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;document &quot;success&quot; and &quot;failure&quot; paths in example&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;rename guide page to &quot;Manage Collection Indexes&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;rename guide file to `manage-collection-indexes.rst`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;rename `example-create-indexes.c` to `example-manage-collection-indexes.c`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;add &quot;See Also&quot; sections&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;link to `createIndexes` documentation for form of `keys`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;document `mongoc_index_model_t`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;change `BSON_ASSERT` to `return NULL;`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;make pointer argument const&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;---------&lt;/p&gt;

&lt;p&gt;Co-authored-by: vector-of-bool &amp;lt;vectorofbool@gmail.com&amp;gt;&lt;br/&gt;
Co-authored-by: Ezra Chung &amp;lt;88335979+eramongodb@users.noreply.github.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/ca45383fcf3843b0f360c72e5296e7bc5335efd9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/ca45383fcf3843b0f360c72e5296e7bc5335efd9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4352938" author="rachelle.palmer" created="Mon, 14 Feb 2022 11:14:52 +0000"  >&lt;p&gt;Flagging for re-triage as I think maybe this can be closed?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1338968">CDRIVER-3646</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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CDRIVER-3870</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY24Q2</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6jke:i</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>