<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:35:52 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-1186] Export SingleResult fields</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1186</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;All fields on &lt;tt&gt;SingleResult&lt;/tt&gt; are not exported, which makes really hard to mock a &lt;tt&gt;FindOne&lt;/tt&gt; request.&lt;/p&gt;

&lt;p&gt;For testing I&apos;ve declared some interfaces, which let me use a mock instead of the driver.&lt;/p&gt;

&lt;p&gt;```&lt;br/&gt;
type MongoCollection interface {&lt;br/&gt;
  InsertOne(ctx context.Context, document interface{},&lt;br/&gt;
    opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)&lt;br/&gt;
  FindOne(ctx context.Context, filter interface{},&lt;br/&gt;
    opts ...*options.FindOneOptions) *mongo.SingleResult&lt;br/&gt;
  DeleteOne(ctx context.Context, filter interface{},&lt;br/&gt;
    opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)&lt;br/&gt;
}&lt;br/&gt;
```&lt;/p&gt;

&lt;p&gt;I can use &lt;tt&gt;mockgen&lt;/tt&gt; to create a mock, but then I cannot create a fake `SingleResult`, only an empty one which only let me test an error situation.&lt;/p&gt;

&lt;p&gt;Having the fields exported would let me test this easily.&lt;/p&gt;</description>
                <environment></environment>
        <key id="834365">GODRIVER-1186</key>
            <summary>Export SingleResult fields</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="pedro.kiefer">Pedro Kiefer</reporter>
                        <labels>
                    </labels>
                <created>Wed, 3 Jul 2019 14:46:23 +0000</created>
                <updated>Fri, 29 Oct 2021 17:15:50 +0000</updated>
                            <resolved>Mon, 8 Jul 2019 20:33:27 +0000</resolved>
                                                                    <component>Testing</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="2315895" author="kris.brandow" created="Mon, 8 Jul 2019 20:33:27 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pedro.kiefer&quot; class=&quot;user-hover&quot; rel=&quot;pedro.kiefer&quot;&gt;pedro.kiefer&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;We generally don&apos;t recommend mocking types that you don&apos;t own and suggest that users write database abstraction layers. We recommend using integration tests if you want to test the types from the &lt;tt&gt;mongo&lt;/tt&gt; package.&lt;/p&gt;

&lt;p&gt;--Kris&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="901138">GODRIVER-1241</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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|huznif:</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>