<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:27 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>[GODRIVER-555] Database.RunCommand should return *DocumentResult</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-555</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;For consistency with how FindOne and similar &quot;single result&quot; methods work, the &lt;tt&gt;Database.RunCommand&lt;/tt&gt; method should return a &lt;tt&gt;*DocumentResult.&lt;/tt&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="605395">GODRIVER-555</key>
            <summary>Database.RunCommand should return *DocumentResult</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="isabella.siu@mongodb.com">Isabella Siu</assignee>
                                    <reporter username="david.golden@mongodb.com">David Golden</reporter>
                        <labels>
                            <label>beta</label>
                    </labels>
                <created>Sat, 15 Sep 2018 12:35:38 +0000</created>
                <updated>Sat, 28 Oct 2023 11:39:27 +0000</updated>
                            <resolved>Tue, 27 Nov 2018 17:27:57 +0000</resolved>
                                                    <fixVersion>0.1.0</fixVersion>
                                    <component>Administrative Commands</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2072994" author="xgen-internal-githook" created="Tue, 27 Nov 2018 17:25:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Isabella Siu&apos;, &apos;email&apos;: &apos;isabella.siu@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-555&quot; title=&quot;Database.RunCommand should return *DocumentResult&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-555&quot;&gt;&lt;del&gt;GODRIVER-555&lt;/del&gt;&lt;/a&gt; make Database.RunCommand return a *SingleResult&lt;/p&gt;

&lt;p&gt;Change-Id: Ica6d147723772fddc89032264d9d6f4d48dcc914&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/a02aaea5a4573384029acf2b31641f78de7eb89b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/a02aaea5a4573384029acf2b31641f78de7eb89b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2012596" author="kris.brandow" created="Mon, 24 Sep 2018 20:06:04 +0000"  >&lt;p&gt;I think this is a valid use case, but I think we should potentially rename DocumentResult to something else. Perhaps SingleResult?&lt;/p&gt;</comment>
                            <comment id="2005575" author="david.golden" created="Mon, 17 Sep 2018 20:19:53 +0000"  >&lt;p&gt;That it&apos;s a single iteration of a cursor is an implementation detail.&#160; Semantically, it&apos;s a BSON-library agnostic result abstraction that can be unmarshalled into a desired type.&#160; Any time there&apos;s a &quot;single document&quot; result, we should be providing the same semantics to users for familiarity.&lt;/p&gt;

&lt;p&gt;Consider what&apos;s required to unmarshall a bson.Reader into a user-defined struct: cast Reader back to bytes and run it through the Unmarshal function.&#160; That&apos;s not user friendly (nor obvious).  Or, if you don&apos;t want to cast (which is a code smell), bson.Marshal it to bytes and then bson.Unmarshal it back. That&apos;s even less user-friendly.&lt;/p&gt;

&lt;p&gt;Worst case, DocumentResult could be an interface and you can have two implementations &#8211; one for a single doc from the OP_REPLY/OP_MSG and one that grabs the first result from a cursor.&#160; However, I think it would be easier to make it abstract a single document and eagerly pull the document from the cursor when constructing the DocumentResult in the FindOne case.&lt;/p&gt;</comment>
                            <comment id="2005554" author="kris.brandow" created="Mon, 17 Sep 2018 20:10:22 +0000"  >&lt;p&gt;The &lt;tt&gt;*DocumentResult&lt;/tt&gt; won&apos;t operate in the same way if we add it to &lt;tt&gt;RunCommand&lt;/tt&gt;. The &lt;tt&gt;*DocumentResult&lt;/tt&gt; is essentially a helper so you don&apos;t have to do a single iteration of a cursor. &lt;tt&gt;*RunCommand&lt;/tt&gt; won&apos;t always return a cursor, so I don&apos;t think it makes sense here. Also, we don&apos;t want to imply that it works like the other single result things, e.g. if you call&#160; &lt;tt&gt;FindOne&lt;/tt&gt; from a &lt;tt&gt;*RunCommand&lt;/tt&gt; it won&apos;t properly unmarshal your result since it&apos;s wrapped in a cursor.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10720">
                    <name>Cloners</name>
                                                                <inwardlinks description="is cloned by">
                                        <issuelink>
            <issuekey id="605874">GODRIVER-557</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>GODRIVER-619</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8atz:</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>