<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:35:43 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-1121] Error when unmarshaling a BSON document if the document has unknown fields</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1121</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;This is in reference to the comment &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/master/bson/bsoncodec/struct_codec.go#L165-L166&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The struct decoder should have the ability to report non-existent field. Go&apos;s json decoder has support for this &lt;a href=&quot;https://golang.org/pkg/encoding/json/#Decoder.DisallowUnknownFields&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documented here&lt;/a&gt;. I&apos;ve played around this a bit, and the quickest way to implement this would be potentially exposing a similar function in the RegistryBuilder`. All decoders have a reference to the registry through DocodeContext.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Definitionofdone&quot;&gt;&lt;/a&gt;&lt;b&gt;Definition of done&lt;/b&gt;&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#505f79&quot;&gt;Add a configuration that causes decoding to return an error if there are fields in the decoded BSON document that don&apos;t match fields in the decode destination struct. Note that this only makes sense when the destination is a struct.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;#505f79&quot;&gt;Add the ability to configure that unmarshal behavior on a MongoDB Client using &lt;tt&gt;BSONOptions&lt;/tt&gt;.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;&lt;a name=&quot;Pitfalls&quot;&gt;&lt;/a&gt;&lt;b&gt;Pitfalls&lt;/b&gt;&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font color=&quot;#505f79&quot;&gt;Adds additional configuration to the &lt;tt&gt;bson.Decoder&lt;/tt&gt; type, which already has a lot of configurable behaviors.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="795515">GODRIVER-1121</key>
            <summary>Error when unmarshaling a BSON document if the document has unknown fields</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="steelphase">Eric Bajumpaa</reporter>
                        <labels>
                            <label>jeff+</label>
                    </labels>
                <created>Mon, 10 Jun 2019 21:16:17 +0000</created>
                <updated>Mon, 8 Jan 2024 22:57:49 +0000</updated>
                                                                            <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2278654" author="steelphase" created="Mon, 10 Jun 2019 22:13:28 +0000"  >&lt;p&gt;I&apos;ve put together a PR with the solution I envisioned &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/163&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/mongo-go-driver#163&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="2494534">GODRIVER-3044</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <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|htywjr:6</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>