<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:33:24 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-30] Implement MGO API</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-30</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description></description>
                <environment></environment>
        <key id="387438">GODRIVER-30</key>
            <summary>Implement MGO API</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="-1">Unassigned</assignee>
                                    <reporter username="craig.wilson@mongodb.com">Craig Wilson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 26 May 2017 17:59:49 +0000</created>
                <updated>Fri, 17 Jul 2020 19:18:12 +0000</updated>
                            <resolved>Fri, 17 Jul 2020 19:18:11 +0000</resolved>
                                                                    <component>Administrative Commands</component>
                    <component>CRUD</component>
                                        <votes>2</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="2204250" author="bartle" created="Sat, 6 Apr 2019 06:24:46 +0000"  >&lt;p&gt;I can understand the reasoning around the second point, though I&apos;m not sure that users of the go driver would necessarily care about the distinction?  As a compromise, could &lt;tt&gt;Find&lt;/tt&gt; do the same thing as &lt;tt&gt;RunCommand&lt;/tt&gt; and &lt;tt&gt;FindOne&lt;/tt&gt; with &lt;tt&gt;SingleResult&lt;/tt&gt;, and pre-set the &lt;tt&gt;Cursor&lt;/tt&gt; error?  That way users can write less verbose code, and for anyone that does care about the distinction (i.e. they want to know &lt;tt&gt;find&lt;/tt&gt; failed vs some subsequent &lt;tt&gt;getMore&lt;/tt&gt;) they have the option of checking the return of &lt;tt&gt;Find&lt;/tt&gt; itself?&lt;/p&gt;</comment>
                            <comment id="2204249" author="bartle" created="Sat, 6 Apr 2019 06:15:47 +0000"  >&lt;p&gt;Ah, I see (&quot;If there was an error from the operation that created this SingleResult then the error will be returned.&quot;).  It might be worth adding something to the godoc for &quot;Err&quot; to clarify that you&apos;d only need to call that method if you didn&apos;t care about the output?&lt;/p&gt;</comment>
                            <comment id="2203733" author="kris.brandow" created="Fri, 5 Apr 2019 18:17:52 +0000"  >&lt;p&gt;To your second point, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bartle&quot; class=&quot;user-hover&quot; rel=&quot;bartle&quot;&gt;bartle&lt;/a&gt;, during the design process we decided that an error to create a cursor was a different category of error from an error with the cursor itself, which is why they are two different errors (this is similar to why &lt;tt&gt;Decode&lt;/tt&gt; provides it&apos;s own error, separate from &lt;tt&gt;Cursor&lt;/tt&gt;).&lt;/p&gt;

&lt;p&gt;To your third point, I&apos;m not sure what you mean. &lt;tt&gt;RunCommand&lt;/tt&gt; only returns returns a &lt;tt&gt;mongo.SingleResult&lt;/tt&gt;, on which you can call &lt;tt&gt;Decode&lt;/tt&gt;. The &lt;tt&gt;Err&lt;/tt&gt; method on &lt;tt&gt;mongo.SingleResult&lt;/tt&gt; should only be used if you don&apos;t want to do anything with the resulting document and only want the &lt;tt&gt;error&lt;/tt&gt;. The &lt;tt&gt;RunCommandCursor&lt;/tt&gt; method returns a &lt;tt&gt;Cursor&lt;/tt&gt; and an error, but that&apos;s to align with the reasoning above.&lt;/p&gt;</comment>
                            <comment id="2199600" author="scott.lhommedieu" created="Tue, 2 Apr 2019 18:59:00 +0000"  >&lt;p&gt;Added this new issue&#160;based on the first bullet from &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bartle&quot; class=&quot;user-hover&quot; rel=&quot;bartle&quot;&gt;bartle&lt;/a&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2188221" author="bartle" created="Fri, 22 Mar 2019 01:16:27 +0000"  >&lt;p&gt;We recently tried to migrate from mgo to mongo-go-driver and discovered a few sharp edges/usability problems.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;There&apos;s no equivalent to mgo&apos;s &lt;tt&gt;All&lt;/tt&gt; method; instead you have to walk the cursor, decode, and append to a slice; this requires 3 error checks and a defer (to close the cursor), instead of 1 error check and no defers with mgo.&lt;/li&gt;
	&lt;li&gt;Why does &lt;tt&gt;Find&lt;/tt&gt; return an error instead of just pre-setting an error on the returned &lt;tt&gt;Cursor&lt;/tt&gt;?&#160; That&apos;s what mgo does and would reduce the number of error checks from 2 to 1.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;RunCommand&lt;/tt&gt; should just accept an output argument, like mgo.&#160; As is, using &lt;tt&gt;RunCommand&lt;/tt&gt; requires checking 2 errors (the function itself and &lt;tt&gt;Decode&lt;/tt&gt;) instead of 1.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="1946114" author="themihai" created="Thu, 12 Jul 2018 20:58:30 +0000"  >&lt;p&gt;It&apos;s worth to note that the &quot;official&quot; API is near&#160;unusable due the lack of documentation and abuse of interface{}.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="727475">GODRIVER-916</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-226</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8b7z:</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>