<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:38:44 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-468] Mention that insert adds the ObjectId to the object passed in</title>
                <link>https://jira.mongodb.org/browse/DOCS-468</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;I was looking for a way to retrieve the ObjectID of the objects being inserted until I found out that it is added automatically to the object I passed to the insert method. This totally makes sense now that I think about it given that the ObjectId is calculated on the client side.I didn&apos;t find this mentioned anywhere so I think it should be added to the documentation.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure this is working with all the drivers but it does at least for the Java one as this little program shows:&lt;br/&gt;
        DBCollection testCollection = testDB.getCollection(&quot;names&quot;);&lt;br/&gt;
        BasicDBObject newName = new BasicDBObject(&quot;name&quot;, &quot;joe&quot;);&lt;br/&gt;
        testCollection.insert(newName);&lt;br/&gt;
        System.out.println(newName);&lt;/p&gt;

&lt;p&gt;{ &quot;name&quot; : &quot;joe&quot; , &quot;_id&quot; : { &quot;$oid&quot; : &quot;50402b3a744e0a126a98fe0e&quot;}}&lt;/p&gt;
</description>
                <environment></environment>
        <key id="48707">DOCS-468</key>
            <summary>Mention that insert adds the ObjectId to the object passed in</summary>
                <type id="5" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14716&amp;avatarType=issuetype">Sub-task</type>
                            <parent id="41649">DOCS-233</parent>
                                    <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="9">Done</resolution>
                                        <assignee username="kay.kim@mongodb.com">Kay Kim</assignee>
                                    <reporter username="gforget">Gui Forget</reporter>
                        <labels>
                            <label>newwriter</label>
                    </labels>
                <created>Fri, 31 Aug 2012 03:15:48 +0000</created>
                <updated>Mon, 30 Oct 2023 22:35:32 +0000</updated>
                            <resolved>Fri, 12 Oct 2012 20:49:04 +0000</resolved>
                                    <version>mongodb-2.2</version>
                                    <fixVersion>Server_Docs_20231030</fixVersion>
                                    <component>manual</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="174427" author="auto" created="Fri, 12 Oct 2012 20:49:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-12T13:48:43-07:00&apos;, u&apos;name&apos;: u&apos;Sam Kleinman&apos;, u&apos;email&apos;: u&apos;samk@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-468&quot; title=&quot;Mention that insert adds the ObjectId to the object passed in&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-468&quot;&gt;&lt;del&gt;DOCS-468&lt;/del&gt;&lt;/a&gt; adding additional clarification&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/063eb9b2b64351d67044d90052c7451f27655331&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/063eb9b2b64351d67044d90052c7451f27655331&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="174377" author="auto" created="Fri, 12 Oct 2012 19:18:02 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-12T12:16:05-07:00&apos;, u&apos;email&apos;: u&apos;samk@10gen.com&apos;, u&apos;name&apos;: u&apos;Sam Kleinman&apos;}
&lt;p&gt;Message: merge: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-468&quot; title=&quot;Mention that insert adds the ObjectId to the object passed in&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-468&quot;&gt;&lt;del&gt;DOCS-468&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/fb68f8cb9974d16f7704e7c1dee01667781aec4b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/fb68f8cb9974d16f7704e7c1dee01667781aec4b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="174376" author="auto" created="Fri, 12 Oct 2012 19:18:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-12T10:54:52-07:00&apos;, u&apos;email&apos;: u&apos;kay.kim@10gen.com&apos;, u&apos;name&apos;: u&apos;kay&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-468&quot; title=&quot;Mention that insert adds the ObjectId to the object passed in&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-468&quot;&gt;&lt;del&gt;DOCS-468&lt;/del&gt;&lt;/a&gt; CRUD drafts&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/f5613178de240fb5f8cbd36d6ed2c23109a26dd8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/f5613178de240fb5f8cbd36d6ed2c23109a26dd8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="169057" author="samk" created="Fri, 28 Sep 2012 02:11:02 +0000"  >&lt;p&gt;for the insert section of the crud chapter&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 28 Sep 2012 02:11:02 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 18 weeks, 5 days 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_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>
                            11 years, 18 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>gforget</customfieldvalue>
            <customfieldvalue>kay.kim@mongodb.com</customfieldvalue>
            <customfieldvalue>sam.kleinman</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrscev:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgge7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9568</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|hryk7r:</customfieldvalue>

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