<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35:47 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-97] Deserializing a BsonDocument to .net object should not throw FormatException if the document has extra properties.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-97</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;If I have a bson document with keys that do not map to properties in a .net object I am deserializing to, a FormatException is thrown.  While I am returning more info than necessary over the wire (doing the mongo equivalent of SELECT * ) I think the code should still function.&lt;/p&gt;


&lt;p&gt;at MongoDB.Bson.DefaultSerializer.BsonClassMapSerializer.DeserializeDocument(BsonReader bsonReader, Type nominalType) in D:\justin&apos;s projects\mongo-csharp\Bson\DefaultSerializer\BsonClassMapSerializer.cs:line 83&lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonSerializer.DeserializeDocument(BsonReader bsonReader, Type nominalType) in D:\justin&apos;s projects\mongo-csharp\Bson\Serialization\BsonSerializer.cs:line 69&lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonSerializer.DeserializeDocument&lt;span class=&quot;error&quot;&gt;&amp;#91;T&amp;#93;&lt;/span&gt;(BsonReader bsonReader) in D:\justin&apos;s projects\mongo-csharp\Bson\Serialization\BsonSerializer.cs:line 45&lt;br/&gt;
   at MongoDB.Driver.Internal.MongoReplyMessage`1.ReadFrom(BsonBuffer buffer) in D:\justin&apos;s projects\mongo-csharp\Driver\Internal\MongoReplyMessage.cs:line 88&lt;br/&gt;
   at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage&lt;span class=&quot;error&quot;&gt;&amp;#91;TDocument&amp;#93;&lt;/span&gt;() in D:\justin&apos;s projects\mongo-csharp\Driver\Internal\MongoConnection.cs:line 291&lt;br/&gt;
   at MongoDB.Driver.MongoCursor`2.MongoCursorEnumerator.GetReply(MongoRequestMessage message) in D:\justin&apos;s projects\mongo-csharp\Driver\Core\MongoCursor.cs:line 477&lt;br/&gt;
   at MongoDB.Driver.MongoCursor`2.MongoCursorEnumerator.GetFirst() in D:\justin&apos;s projects\mongo-csharp\Driver\Core\MongoCursor.cs:line 442&lt;br/&gt;
   at MongoDB.Driver.MongoCursor`2.MongoCursorEnumerator.MoveNext() in D:\justin&apos;s projects\mongo-csharp\Driver\Core\MongoCursor.cs:line 369&lt;br/&gt;
   at System.Linq.Enumerable.FirstOrDefault&lt;span class=&quot;error&quot;&gt;&amp;#91;TSource&amp;#93;&lt;/span&gt;(IEnumerable`1 source)&lt;br/&gt;
   at MongoDB.Driver.MongoCollection.FindOneAs&lt;span class=&quot;error&quot;&gt;&amp;#91;TQuery,TDocument&amp;#93;&lt;/span&gt;(TQuery query) in D:\justin&apos;s projects\mongo-csharp\Driver\Core\MongoCollection.cs:line 292&lt;br/&gt;
   at MongoDB.Driver.MongoCollection.FindOneAs&lt;span class=&quot;error&quot;&gt;&amp;#91;TDocument&amp;#93;&lt;/span&gt;(IBsonSerializable query) in D:\justin&apos;s projects\mongo-csharp\Driver\Core\MongoCollection.cs:line 286&lt;br/&gt;
   at BEGIN MY COMPANIES CODE&lt;/p&gt;
</description>
                <environment>VS 2k8 Win7</environment>
        <key id="13692">CSHARP-97</key>
            <summary>Deserializing a BsonDocument to .net object should not throw FormatException if the document has extra properties.</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="zippy1981">Justin Dearing</reporter>
                        <labels>
                    </labels>
                <created>Sun, 14 Nov 2010 18:10:42 +0000</created>
                <updated>Thu, 2 Apr 2015 18:27:43 +0000</updated>
                            <resolved>Sun, 14 Nov 2010 23:47:20 +0000</resolved>
                                                    <fixVersion>0.7</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="20312" author="rstam" created="Sun, 14 Nov 2010 23:47:20 +0000"  >&lt;p&gt;Works as designed.&lt;/p&gt;</comment>
                            <comment id="20310" author="zippy1981" created="Sun, 14 Nov 2010 18:32:20 +0000"  >&lt;p&gt;Ok that works for me. You can close this, and thanks for pointing out the risks,&lt;/p&gt;</comment>
                            <comment id="20309" author="rstam" created="Sun, 14 Nov 2010 18:27:31 +0000"  >&lt;p&gt;You can always use &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonIgnoreExtraElements&amp;#93;&lt;/span&gt; to deserialize documents with extra elements.&lt;/p&gt;

&lt;p&gt;This question is whether it is safe to ignore extra elements without your permission. I think it is not, as it can easily lead to data loss (for example, if you save the document back to the database).&lt;/p&gt;</comment>
                    </comments>
                    <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|hrh9pj:</customfieldvalue>

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