<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:17:07 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-3093] Include inserted _Ids in insert_one() and insert() results</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3093</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;As per &lt;a href=&quot;http://mongoc.org/libmongoc/current/mongoc_collection_insert_one.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongoc.org/libmongoc/current/mongoc_collection_insert_one.html&lt;/a&gt; and &lt;a href=&quot;http://mongoc.org/libmongoc/current/mongoc_collection_insert.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongoc.org/libmongoc/current/mongoc_collection_insert.html&lt;/a&gt;, there is currently no option to return the generated _id(s):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If no _id element is found in document, then a bson_oid_t will be generated locally and added to the document. If you must know the inserted document&#8217;s _id, generate it in your code and include it in the document. The _id you generate can be a bson_oid_t or any other non-array BSON type.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Although providing the inserted id(s) is not required according to the MongoDB &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#results&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CRUD spec&lt;/a&gt;, it would be useful to expose this in the C driver to assist downstream drivers such as &lt;tt&gt;mongolite&lt;/tt&gt; that use &lt;tt&gt;libmongoc&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="743316">CDRIVER-3093</key>
            <summary>Include inserted _Ids in insert_one() and insert() results</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="stephen.steneker@mongodb.com">Stennie Steneker</reporter>
                        <labels>
                            <label>neweng</label>
                    </labels>
                <created>Tue, 23 Apr 2019 02:00:13 +0000</created>
                <updated>Tue, 7 Mar 2023 10:56:46 +0000</updated>
                                                                            <component>libmongoc</component>
                                        <votes>2</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="2277717" author="kevin.albertson" created="Mon, 10 Jun 2019 14:46:50 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=stennie&quot; class=&quot;user-hover&quot; rel=&quot;stennie&quot;&gt;stennie&lt;/a&gt;, is there another issue to link to?&lt;/p&gt;</comment>
                            <comment id="2246249" author="jmikola@gmail.com" created="Tue, 14 May 2019 17:41:25 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=stennie&quot; class=&quot;user-hover&quot; rel=&quot;stennie&quot;&gt;stennie&lt;/a&gt;: Still waiting for an issue to cross-reference if you have it handy.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;On a separate note, this issue came up in relation to &lt;a href=&quot;https://jira.mongodb.org/browse/PHPLIB-428&quot; title=&quot;Report successfully inserted IDs after bulk write errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPLIB-428&quot;&gt;PHPLIB-428&lt;/a&gt;. While implementing the retryable writes test runner, I realized that it&apos;s quite difficult to assert inserted IDs from incomplete write results returned after a bulk write error. As described in that issue, I believe it&apos;s possible to calculate the map of inserted IDs that we expect to have completed successfully but it&apos;s a fair bit of work.&lt;/p&gt;</comment>
                            <comment id="2221718" author="jmikola@gmail.com" created="Tue, 23 Apr 2019 13:10:44 +0000"  >&lt;p&gt;Is there another issue to cross-reference with this request for added context? This isn&apos;t terribly difficult to implement in a wrapping driver (e.g. PHP, Swift), as it&apos;s a matter of fetching the &lt;tt&gt;_id&lt;/tt&gt; field from the document(s). Does &lt;tt&gt;mongolite&lt;/tt&gt; provide no abstraction around libmongoc&apos;s own result objects?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="768180">PHPLIB-428</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000dWWGlQAO]]]></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_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>FY24Q3</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6jhr:</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>