<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:03 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-360] Correct semantics of bson.Document.Lookup method</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-360</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Currently, bson.Document.Lookup returns a &lt;tt&gt;*bson.Element&lt;/tt&gt; and an &lt;tt&gt;error&lt;/tt&gt;. This represents a shift from both the way that a Go &lt;tt&gt;map&lt;/tt&gt; functions and the way the &lt;tt&gt;bson.Value&lt;/tt&gt;, &lt;tt&gt;bson.ElementConstructor&lt;/tt&gt;, and &lt;tt&gt;bson.ValueConstructor&lt;/tt&gt; types function. All three of those types support a single value and dual value access method, e.g. &lt;tt&gt;bson.Value.Boolean&lt;/tt&gt; and &lt;tt&gt;bson.Value.BooleanOK&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;To better align to the semantics of the other types in the package, the &lt;tt&gt;bson.Document&lt;/tt&gt; type should have two lookup functions, &lt;tt&gt;bson.Document.Lookup&lt;/tt&gt; and &lt;tt&gt;bson.Document.LookupErr&lt;/tt&gt;. In the case where an element does not exist, &lt;tt&gt;bson.Document.Lookup&lt;/tt&gt; return nil. Since the &lt;tt&gt;map&lt;/tt&gt; type in Go also supports accessing a nil &lt;tt&gt;map&lt;/tt&gt;, we should support this as well. For the &lt;tt&gt;Lookup&lt;/tt&gt;, &lt;tt&gt;LookupErr&lt;/tt&gt;, &lt;tt&gt;ElementAt&lt;/tt&gt;, and &lt;tt&gt;ElementAtOK&lt;/tt&gt; methods return a nil element if the &lt;tt&gt;*Document&lt;/tt&gt; is nil. In the case of &lt;tt&gt;LookupErr&lt;/tt&gt; return an &lt;tt&gt;ErrNilDocument&lt;/tt&gt; error and in the case of &lt;tt&gt;ElementAtOK&lt;/tt&gt; return &lt;tt&gt;false&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Finally, the &lt;tt&gt;Lookup&lt;/tt&gt; method does not currently support an empty string. There is nothing in BSON the precludes a key from being empty, so add support for empty strings with &lt;tt&gt;Lookup&lt;/tt&gt; and &lt;tt&gt;LookupErr&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="525410">GODRIVER-360</key>
            <summary>Correct semantics of bson.Document.Lookup method</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="13201">Fixed</resolution>
                                        <assignee username="sam.kleinman">Sam Kleinman</assignee>
                                    <reporter username="kris.brandow@mongodb.com">Kristofer Brandow</reporter>
                        <labels>
                            <label>FreeMonitoring</label>
                    </labels>
                <created>Wed, 11 Apr 2018 18:20:44 +0000</created>
                <updated>Sat, 28 Oct 2023 11:39:39 +0000</updated>
                            <resolved>Wed, 23 May 2018 13:14:02 +0000</resolved>
                                    <version>0.0.2</version>
                                    <fixVersion>0.0.6</fixVersion>
                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1898917" author="xgen-internal-githook" created="Tue, 22 May 2018 21:07:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;tychoish&apos;, &apos;name&apos;: &apos;Sam Kleinman&apos;, &apos;email&apos;: &apos;sam@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-360&quot; title=&quot;Correct semantics of bson.Document.Lookup method&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-360&quot;&gt;&lt;del&gt;GODRIVER-360&lt;/del&gt;&lt;/a&gt;: correct semantics for bson.Lookup and friends&lt;/p&gt;

&lt;p&gt;Change-Id: I48774e72943378695b1ac3ae31a53ad43c4fdce7&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/ba9aede20a65c32ae92bded3fc74d7281d7e00c5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/ba9aede20a65c32ae92bded3fc74d7281d7e00c5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1861785" author="kris.brandow" created="Wed, 11 Apr 2018 19:04:50 +0000"  >&lt;p&gt;To further align with the semantics of the &lt;tt&gt;map&lt;/tt&gt; type, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=craiggwilson&quot; class=&quot;user-hover&quot; rel=&quot;craiggwilson&quot;&gt;craiggwilson&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jeff.yemin&quot; class=&quot;user-hover&quot; rel=&quot;jeff.yemin&quot;&gt;jeff.yemin&lt;/a&gt; have suggested we have &lt;tt&gt;Lookup&lt;/tt&gt; and &lt;tt&gt;LookupErr&lt;/tt&gt; return a &lt;tt&gt;*bson.Value&lt;/tt&gt; instead of a &lt;tt&gt;*bson.Element&lt;/tt&gt;. To ensure that users can still retrieve a &lt;tt&gt;*bson.Element&lt;/tt&gt; if they want to, additionally add a &lt;tt&gt;LookupElement&lt;/tt&gt; method with the following signature:&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;   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;LookupElement(key ...string) (*Element, error)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="541622">GODRIVER-412</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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-412</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9mx3:</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>