<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:37:33 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-1980] BSON Type 0x00 (document) missing</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1980</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/v1.5.1/bson/bsontype/bsontype.go#L13&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;bsontype.go&lt;/a&gt; does not include `0x00` for top level document types per the &lt;a href=&quot;http://bsonspec.org/spec.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;bsonspec.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This can be seen when using `UnmarshalBSONValue` to determine the document type.&lt;/p&gt;

&lt;p&gt;Attached code to duplicate the issue.&lt;/p&gt;
</description>
                <environment>Linux</environment>
        <key id="1689912">GODRIVER-1980</key>
            <summary>BSON Type 0x00 (document) missing</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="13202">Works as Designed</resolution>
                                        <assignee username="isabella.siu@mongodb.com">Isabella Siu</assignee>
                                    <reporter username="mike.dotson@its-broke.com">Mike Dotson</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Apr 2021 18:23:01 +0000</created>
                <updated>Fri, 27 Oct 2023 13:16:24 +0000</updated>
                            <resolved>Mon, 10 May 2021 20:24:57 +0000</resolved>
                                    <version>1.5.1</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3740018" author="isabella.siu" created="Mon, 26 Apr 2021 21:55:16 +0000"  >&lt;p&gt;Hi again &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mike.dotson%40its-broke.com&quot; class=&quot;user-hover&quot; rel=&quot;mike.dotson@its-broke.com&quot;&gt;mike.dotson@its-broke.com&lt;/a&gt;! The main reason that we don&apos;t have a value for top-level document is because the&#160;documentation doesn&apos;t include it on either the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/bson-types&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MongoDB docs&lt;/a&gt; or &lt;a href=&quot;http://bsonspec.org/spec.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;bsonspec.org&lt;/a&gt;. The top-level document doesn&apos;t have an identifying byte, as the 0x00 byte on the bsonspec is a null-terminal. A bsontype represent the type value for a key/value pair.&lt;br/&gt;
 To avoid checking for 0x00, you can have both UnmarshalBSON and UnmarshalBSONValue implemented, and documents will go to UnmarshalBSON and values will go to UnmarshalBSONValue.&lt;/p&gt;</comment>
                            <comment id="3739882" author="JIRAUSER1259703" created="Mon, 26 Apr 2021 21:02:13 +0000"  >&lt;p&gt;Hi @Isabella Siu,&lt;/p&gt;

&lt;p&gt;I actually don&apos;t know that it&apos;s a BSON document, hence the checks.&#160; If it&apos;s not a `bsontype.EmbeddedDocument` or (in this case `\x00`, ie `bsontype.Document`?) I fail the marshaling without the need to process the bytes to find it&apos;s not something that will result in a valid unmarshal (ie, single double that should result as a map&lt;span class=&quot;error&quot;&gt;&amp;#91;string&amp;#93;&lt;/span&gt;int64)&lt;/p&gt;

&lt;p&gt;I also have other types that are unmarshaled based off of types such as `bsontype.Null`, `bsontype.Int32`, `bsontype.Int64`, etc. that work as expected.&lt;/p&gt;

&lt;p&gt;Having the go driver return &quot;invalid&quot; string for a valid document seems a bit off and definitely makes the code look a bit awkward when reading and seeing this odd `\x00` check.&lt;/p&gt;

&lt;p&gt;Look forward to the conclusion on the 0x00 type.&lt;/p&gt;

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

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="3739754" author="isabella.siu" created="Mon, 26 Apr 2021 20:22:58 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mike.dotson%40its-broke.com&quot; class=&quot;user-hover&quot; rel=&quot;mike.dotson@its-broke.com&quot;&gt;mike.dotson@its-broke.com&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;If you know that the type that you&apos;re unmarshaling is a BSON document, we recommend implementing UnmarshalBSON instead. We&apos;re still discussing what to do with the 0x00 type, and will update this ticket when when we come to a conclusion.&lt;/p&gt;</comment>
                            <comment id="3736390" author="JIRAUSER1259703" created="Fri, 23 Apr 2021 18:35:16 +0000"  >&lt;p&gt;output from code:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;2021/04/23 12:18:55 -------- test 1 --------&lt;br/&gt;
2021/04/23 12:18:55   document -&amp;gt; 00:invalid&lt;br/&gt;
2021/04/23 12:18:55        _id -&amp;gt; 07:objectID&lt;br/&gt;
2021/04/23 12:18:55      title -&amp;gt; 02:string&lt;br/&gt;
2021/04/23 12:18:55     subdoc -&amp;gt; 03:embedded document&lt;br/&gt;
2021/04/23 12:18:55 -------- test 2 --------&lt;br/&gt;
2021/04/23 12:18:55   document -&amp;gt; 00:invalid&lt;br/&gt;
2021/04/23 12:18:55       key1 -&amp;gt; 02:string&lt;br/&gt;
2021/04/23 12:18:55       key2 -&amp;gt; 01:double&lt;br/&gt;
2021/04/23 12:18:55       key3 -&amp;gt; 07:objectID&lt;br/&gt;
2021/04/23 12:18:55       key4 -&amp;gt; 18:64-bit integer&lt;br/&gt;
2021/04/23 12:18:55       key5 -&amp;gt; 16:32-bit integer&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="311641" name="main.go" size="2605" author="mike.dotson@its-broke.com" created="Fri, 23 Apr 2021 18:23:14 +0000"/>
                    </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_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;May need to include new Document type in the godoc.&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyranb:</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>