<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:57:46 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>[SERVER-1699] Fill in _id value for inserted docs</title>
                <link>https://jira.mongodb.org/browse/SERVER-1699</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The _id value should be set in the document by the shell (driver) before it is sent to the server.&lt;/p&gt;

&lt;p&gt;&amp;gt; var test = &lt;/p&gt;
{a:1}
&lt;p&gt;&amp;gt; db.test11.insert(test)&lt;br/&gt;
&amp;gt; test&lt;/p&gt;
{ &quot;a&quot; : 1 }

&lt;p&gt;&amp;#8212; I would like to see the _id field after the insert&lt;/p&gt;

&lt;p&gt;&amp;gt; var test = &lt;/p&gt;
{a:1}
&lt;p&gt;&amp;gt; db.test11.insert(test)&lt;br/&gt;
&amp;gt; test&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;....&quot;), &quot;a&quot; : 1 }</description>
                <environment></environment>
        <key id="12947">SERVER-1699</key>
            <summary>Fill in _id value for inserted docs</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-platform">DO NOT USE - Backlog - Platform Team</assignee>
                                    <reporter username="scotthernandez">Scott Hernandez</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Aug 2010 03:26:26 +0000</created>
                <updated>Fri, 3 Feb 2017 19:55:07 +0000</updated>
                            <resolved>Fri, 3 Feb 2017 19:55:07 +0000</resolved>
                                    <version>1.6.1</version>
                                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="42159" author="timvanelsloo" created="Wed, 13 Jul 2011 15:43:49 +0000"  >&lt;p&gt;This actually does happen when you insert new objects using the PHP-driver, which is great. Since writes are very fast, most of the time _id is already set, even if you didn&apos;t provide the $safe-param (which you should do, if your application relies on this).&lt;/p&gt;

&lt;p&gt;Now, back to the shell-driver. This probably isn&apos;t working because (afaik) JS doesn&apos;t support pass-by-reference, which is needed to accomplish what you want. For example:&lt;/p&gt;

&lt;p&gt;PHP:&lt;br/&gt;
$obj = array(&apos;foo&apos; =&amp;gt; &apos;bar&apos;);&lt;br/&gt;
change(&amp;amp;$obj); // in PHP5, the &amp;amp;-symbol isn&apos;t needed anymore.&lt;br/&gt;
print_r($obj);&lt;/p&gt;

&lt;p&gt;function change($obj) {&lt;br/&gt;
    $obj&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;foo&amp;#39;&amp;#93;&lt;/span&gt; = &apos;foo&apos;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;This will print something like array(&apos;foo&apos; =&amp;gt; &apos;foo&apos;);&lt;/p&gt;

&lt;p&gt;However, this isn&apos;t possible in JS (there&apos;s no &amp;amp;-symbol either):&lt;br/&gt;
var obj = &lt;/p&gt;
{&apos;foo&apos;: &apos;bar&apos;}
&lt;p&gt;;&lt;br/&gt;
change(obj);&lt;br/&gt;
alert(obj.foo);&lt;/p&gt;

&lt;p&gt;function change(obj) {&lt;br/&gt;
    obj.foo = &apos;foo&apos;;&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;This will alert &apos;bar&apos;, because there&apos;s no such thing in JS.&lt;/p&gt;

&lt;p&gt;This would be great, but isn&apos;t possible without modifying the underlying js-engine.&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="50447">SERVER-7033</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 13 Jul 2011 15:43:49 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 32 weeks 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>mira.carey@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 32 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-platform</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
            <customfieldvalue>timvanelsloo</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpgan:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5117</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht0ptb:</customfieldvalue>

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