<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35:50 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-112] Make C# driver deserialize Doubles and LongNumber(Int64) in MongoDocuments to Int32s</title>
                <link>https://jira.mongodb.org/browse/CSHARP-112</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;If you do a db.collection.insert(&lt;/p&gt;
{&quot;Capacity&quot; : new NumberLong(75)}
&lt;p&gt;) and &lt;br/&gt;
deserialize it from the Csharp driver you get an &lt;br/&gt;
InvalidOperationException: ReadInt32 cannot be called when BsonType is: &lt;br/&gt;
Int64. If I just enter a number javascript thinks it a float and I get a &lt;br/&gt;
similar error. &lt;/p&gt;

&lt;p&gt;The Csharp drivers deserialization should be more forgiving. In the case of Int64 to int32, overflow should cause an exception to occur.&lt;br/&gt;
In the case of double to int32, an exception should be thrown if fractional parts are truncated.&lt;/p&gt;

&lt;p&gt;Stack trace of the exception &lt;br/&gt;
   at MongoDB.Bson.IO.BsonBinaryReader.VerifyBsonType(String methodName, &lt;br/&gt;
BsonType requiredBsonType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\IO\BsonBinaryReader.cs:line 587 &lt;br/&gt;
   at MongoDB.Bson.IO.BsonBinaryReader.ReadInt32() in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\IO\BsonBinaryReader.cs:line 283 &lt;br/&gt;
   at MongoDB.Bson.DefaultSerializer.Int32Serializer.Deserialize(BsonReader &lt;br/&gt;
bsonReader, Type nominalType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\Serializers\BsonPrimitiveSeria lizers.cs:line &lt;br/&gt;
418 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.BsonBaseSerializer.Deserialize(BsonReader &lt;br/&gt;
bsonReader, Type nominalType, Type actualType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\Serializers\BsonBaseSerializer .cs:line &lt;br/&gt;
46 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.BsonClassMapSerializer.DeserializeMember(Bso nReader &lt;br/&gt;
bsonReader, Object obj, BsonMemberMap memberMap) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\BsonClassMapSerializer.cs:line &lt;br/&gt;
221 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.BsonClassMapSerializer.Deserialize(BsonReade r &lt;br/&gt;
bsonReader, Type nominalType, Type actualType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\BsonClassMapSerializer.cs:line &lt;br/&gt;
95 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.EnumerableSerializer`1.Deserialize(BsonReade r &lt;br/&gt;
bsonReader, Type nominalType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\Serializers\CollectionGenericS erializers.cs:line &lt;br/&gt;
68 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.BsonBaseSerializer.Deserialize(BsonReader &lt;br/&gt;
bsonReader, Type nominalType, Type actualType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\Serializers\BsonBaseSerializer .cs:line &lt;br/&gt;
46 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.BsonClassMapSerializer.DeserializeMember(Bso nReader &lt;br/&gt;
bsonReader, Object obj, BsonMemberMap memberMap) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\BsonClassMapSerializer.cs:line &lt;br/&gt;
221 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.BsonClassMapSerializer.Deserialize(BsonReade r &lt;br/&gt;
bsonReader, Type nominalType, Type actualType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\BsonClassMapSerializer.cs:line &lt;br/&gt;
95 &lt;br/&gt;
   at &lt;br/&gt;
MongoDB.Bson.DefaultSerializer.BsonClassMapSerializer.Deserialize(BsonReade r &lt;br/&gt;
bsonReader, Type nominalType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\DefaultSerializer\BsonClassMapSerializer.cs:line &lt;br/&gt;
63 &lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonSerializer.Deserialize(BsonReader &lt;br/&gt;
bsonReader, Type nominalType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\Serialization\BsonSerializer.cs:line 76 &lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonSerializer.Deserialize(Stream stream, &lt;br/&gt;
Type nominalType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\Serialization\BsonSerializer.cs:line 93 &lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonSerializer.Deserialize(Byte[] bytes, &lt;br/&gt;
Type nominalType) in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\Serialization\BsonSerializer.cs:line 84 &lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonSerializer.Deserialize&lt;span class=&quot;error&quot;&gt;&amp;#91;T&amp;#93;&lt;/span&gt;(Byte[] bytes) &lt;br/&gt;
in D:\justin&apos;s &lt;br/&gt;
projects\mongo-csharp\Bson\Serialization\BsonSerializer.cs:line 58 &lt;br/&gt;
   at &lt;br/&gt;
Wunderman.EventRSVPSite.DataAccess.EventManager.GetEventLocations&lt;span class=&quot;error&quot;&gt;&amp;#91;T,t&amp;#93;&lt;/span&gt;(Obje ctId &lt;br/&gt;
id) in D:\justin&apos;s &lt;br/&gt;
projects\LRT-MSC-O03023_EventRsvpSite\EventRSVPSite.DataAccess\EventManager .cs:line &lt;br/&gt;
109 &lt;br/&gt;
   at &lt;br/&gt;
Wunderman.EventRSVPSite.Service.RsvpService.GetEventLocations(GetEventReque st &lt;br/&gt;
request) in D:\justin&apos;s &lt;br/&gt;
projects\LRT-MSC-O03023_EventRsvpSite\EventRSVPSite.Service\RsvpService.cs: line &lt;br/&gt;
68 &lt;br/&gt;
   at SyncInvokeGetEventLocations(Object , Object[] , Object[] ) &lt;br/&gt;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object &lt;br/&gt;
instance, Object[] inputs, Object[]&amp;amp; outputs) &lt;br/&gt;
   at &lt;br/&gt;
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(Message Rpc&amp;amp; &lt;br/&gt;
rpc) &lt;/p&gt;</description>
                <environment>Visual Studio 2008</environment>
        <key id="13775">CSHARP-112</key>
            <summary>Make C# driver deserialize Doubles and LongNumber(Int64) in MongoDocuments to Int32s</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="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>Mon, 22 Nov 2010 18:22:36 +0000</created>
                <updated>Thu, 2 Apr 2015 18:27:58 +0000</updated>
                            <resolved>Mon, 22 Nov 2010 20:37:02 +0000</resolved>
                                    <version>0.7</version>
                    <version>0.9</version>
                                    <fixVersion>0.9</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                                                            <comments>
                            <comment id="20600" author="rstam" created="Mon, 22 Nov 2010 20:37:02 +0000"  >&lt;p&gt;Int32Serialize will now convert Double or Int64 to Int32 and will only throw an exception if data loss occurs.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                            <subtask id="13781">CSHARP-113</subtask>
                    </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|hrh9mf:</customfieldvalue>

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