<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38:19 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>[CSHARP-965] Globally Set [BsonIgnoreExtraElements]</title>
                <link>https://jira.mongodb.org/browse/CSHARP-965</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I&apos;m new to MongoDB and the CSharp driver and I&apos;m looking for a way to set &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonIgnoreExtraElements&amp;#93;&lt;/span&gt; by default and add the ability for the developer to reverse the default. &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Set BsonIgnoreExtraElements Globally.&lt;/li&gt;
	&lt;li&gt;New attribute BsonIncludeAllElements (Or Similar) to throw exception when attribute isn&apos;t found - should the developer need this for certain models.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Would this be something the team would consider? Happy to submit the pull request. &lt;/p&gt;</description>
                <environment></environment>
        <key id="134747">CSHARP-965</key>
            <summary>Globally Set [BsonIgnoreExtraElements]</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="5" iconUrl="https://jira.mongodb.org/images/icons/priorities/trivial.svg">Trivial - P5</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="Pino">Liam Bateman [X]</reporter>
                        <labels>
                            <label>bson</label>
                            <label>question</label>
                    </labels>
                <created>Sat, 3 May 2014 20:04:27 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:32 +0000</updated>
                            <resolved>Sat, 3 May 2014 23:56:23 +0000</resolved>
                                                                    <component>Configuration</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="571895" author="craiggwilson" created="Sat, 3 May 2014 23:56:16 +0000"  >&lt;p&gt;As for the second part, you can write your own custom attribute that implements IBsonClassMapAttribute.  It will get picked up by the mapping system.  You could then also write a convention that throws an exception when this attribute isn&apos;t found.&lt;/p&gt;

&lt;p&gt;I believe, in general, your approach is not the norm.  It means that, by default, you&apos;re going to be losing data without knowing it. Therefore, we aren&apos;t going to provide these for you, but all the tools are there for you build them yourself.&lt;/p&gt;</comment>
                            <comment id="571892" author="craiggwilson" created="Sat, 3 May 2014 23:52:56 +0000"  >&lt;p&gt;This should be possible by registering a convention. In fact, we have a convention already built for this purpose: &lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/blob/v1.x/MongoDB.Bson/Serialization/Conventions/IgnoreExtraElementsConvention.cs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/blob/v1.x/MongoDB.Bson/Serialization/Conventions/IgnoreExtraElementsConvention.cs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the documentation here for how to register it: &lt;a href=&quot;http://docs.mongodb.org/ecosystem/tutorial/serialize-documents-with-the-csharp-driver/#conventions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://docs.mongodb.org/ecosystem/tutorial/serialize-documents-with-the-csharp-driver/#conventions&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="571807" author="pino" created="Sat, 3 May 2014 20:07:00 +0000"  >&lt;p&gt;I&apos;ve stumbled upon an older ticket that requests this, while not quite the same it does facilitate the ability to set it but it&apos;s per class. Is there a way to do for all classes all the time? &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-681&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/CSHARP-681&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <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|hrykaf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>115866</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>