<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:18:19 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-71197] Restore the detailed JSON return document the getLastError used to return</title>
                <link>https://jira.mongodb.org/browse/SERVER-71197</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Prior to version 5.1, getLastError, db.getLastError(), or db.getLastErrorObj() could be used to get detailed information about the success or failure of write operations:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&#160; mongo &amp;lt;&amp;lt; host/port/user etc &amp;gt;&amp;gt; --quiet&#160;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; --eval &quot;db.ValidProducts.drop();printjson(db.runCommand( { getLastError: 1 } ));&quot;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&#160; {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &quot;connectionId&quot; : 2869,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &quot;n&quot; : 0,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &quot;syncMillis&quot; : 0,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &quot;writtenTo&quot; : null,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &quot;err&quot; : null,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &quot;ok&quot; : 1&lt;/tt&gt;&lt;/p&gt;
{\{&#160; }
&lt;p&gt;}}&lt;/p&gt;

&lt;p&gt;In MongoDB version 6.0, &lt;a href=&quot;https://www.mongodb.com/docs/manual/reference/command/getLastError/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getLastError was removed&lt;/a&gt; and write commands often only return a boolean, instead of the detailed JSON output:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&#160; mongosh &amp;lt;&amp;lt; host/port/user etc &amp;gt;&amp;gt; --quiet&#160;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; &#160; --eval &quot;var drc = db.ValidProducts.drop(); printjson(drc)&quot;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; false&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;This request is to restore the ability to get more detailed return documents from write operations.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2178848">SERVER-71197</key>
            <summary>Restore the detailed JSON return document the getLastError used to return</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="david.storch@mongodb.com">David Storch</assignee>
                                    <reporter username="william.byrne@mongodb.com">William Byrne III</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Nov 2022 04:42:16 +0000</created>
                <updated>Mon, 28 Nov 2022 21:15:57 +0000</updated>
                            <resolved>Mon, 28 Nov 2022 21:15:57 +0000</resolved>
                                    <version>6.0.2</version>
                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5013005" author="david.storch" created="Mon, 28 Nov 2022 21:15:57 +0000"  >&lt;p&gt;Given the lack of information about the exact behavior requested by this ticket, I am closing it as &quot;Won&apos;t Do&quot;. See my previous comment for a more detailed description of why we removed support for the &lt;tt&gt;getLastError&lt;/tt&gt; command and what information we need in order to take action on this request. Please feel free to provide additional information about your use case or requirements, in which case we would be happy to re-open and re-triage this ticket!&lt;/p&gt;</comment>
                            <comment id="4984766" author="david.storch" created="Tue, 15 Nov 2022 20:28:02 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=william.byrne%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;william.byrne@mongodb.com&quot;&gt;william.byrne@mongodb.com&lt;/a&gt;! In order to act on this ticket, I think we need more information regarding what information exactly you would like to receive in response to a write operation. Your example involves a collection drop. Bypassing the legacy &lt;tt&gt;mongo&lt;/tt&gt; shell helpers and running the command directly, the response to the command looks like this:&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;MongoDB Enterprise &amp;gt; db.runCommand({drop: &quot;c&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;   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;nIndexesWas&quot; : 3, &quot;ns&quot; : &quot;test.c&quot;, &quot;ok&quot; : 1 }&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;That&apos;s what the OP_MSG reply payload sent from the server to the shell actually looks like; no other information about the result of the &lt;tt&gt;drop&lt;/tt&gt; command is actually returned to the client. Can you tell me more about your use case? What were you using &lt;tt&gt;getLastError&lt;/tt&gt; for that you can no longer achieve, or what specific information do you want to be returned and by what commands?&lt;/p&gt;

&lt;p&gt;As a postscript, I&apos;d like to add that I don&apos;t see us ever restoring the actual &lt;tt&gt;getLastError&lt;/tt&gt; command or the corresponding shell helpers. The &lt;tt&gt;getLastError&lt;/tt&gt; command was designed to be used by drivers in connection with the legacy op codes for doing writes (OP_INSERT, OP_UPDATE, and OP_DELETE). When we removed support for these legacy op codes, it meant that supported drivers no longer needed to run &lt;tt&gt;getLastError&lt;/tt&gt; commands. This enabled us to delete the code implementing the &lt;tt&gt;getLastError&lt;/tt&gt; command and its underlying infrastructure, which was an important elimination of tech debt to simplify our code base.&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>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5006R00001owc2lQAA]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 15 Nov 2022 20:28:02 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 10 weeks, 2 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>david.storch@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 10 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>william.byrne@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1hg3j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i102dk:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="5920">QE 2022-11-28</customfieldvalue>
    <customfieldvalue id="5922">QE 2022-12-12</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_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|i1h28v:</customfieldvalue>

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