<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:42:05 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-2271] ObjectSerializer should support deserializing all BSON types</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2271</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;We&apos;ve brought up a purely fresh 3.6.3 (now 3.6.4) mongo database from scratch. Having tried with 2.5 through 2.6... When attempting to test our connection, in which we simply run a &quot;ping&quot; command when connecting, we&apos;re getting the following exception about Timestamp BSON type not being supported:&lt;/p&gt;

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

&lt;p&gt;{{ObjectSerializer does not support BSON type &apos;Timestamp&apos;.: at }}&lt;br/&gt;
{{ MongoDB.Bson.Serialization.Serializers.ObjectSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args) at }}&lt;br/&gt;
{{ MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize&lt;span class=&quot;error&quot;&gt;&amp;#91;TValue&amp;#93;&lt;/span&gt;(IBsonSerializer`1 serializer, BsonDeserializationContext context) at }}&lt;br/&gt;
{{ MongoDB.Bson.Serialization.Serializers.DynamicDocumentBaseSerializer`1.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args) at }}&lt;br/&gt;
{{ MongoDB.Bson.Serialization.Serializers.SerializerBase`1.MongoDB.Bson.Serialization.IBsonSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args) at }}&lt;br/&gt;
{{ MongoDB.Bson.Serialization.Serializers.ObjectSerializer.DeserializeDiscriminatedValue(BsonDeserializationContext context, BsonDeserializationArgs args) at }}&lt;br/&gt;
{{ MongoDB.Bson.Serialization.Serializers.ObjectSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args) at }}&lt;br/&gt;
{{ MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize&lt;span class=&quot;error&quot;&gt;&amp;#91;TValue&amp;#93;&lt;/span&gt;(IBsonSerializer`1 serializer, BsonDeserializationContext context) at }}&lt;br/&gt;
{{ MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.ProcessReply(ConnectionId connectionId, ReplyMessage`1 reply) at }}&lt;br/&gt;
{{ MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.&amp;lt;ExecuteAsync&amp;gt;d__15.MoveNext() &#8212; End of stack trace from previous location where exception was thrown &#8212; at }}&lt;br/&gt;
{{ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at }}&lt;br/&gt;
{{ MongoDB.Driver.Core.Servers.Server.ServerChannel.&amp;lt;ExecuteProtocolAsync&amp;gt;d__27`1.MoveNext() &#8212; End of stack trace from previous location where exception was thrown &#8212; at }}&lt;br/&gt;
{{ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at}}&lt;br/&gt;
{{ MongoDB.Driver.Core.Operations.CommandOperationBase`1.&amp;lt;ExecuteProtocolAsync&amp;gt;d__28.MoveNext() &#8212; End of stack trace from previous location where exception was thrown &#8212; at }}&lt;br/&gt;
{{ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at }}&lt;br/&gt;
{{ MongoDB.Driver.Core.Operations.ReadCommandOperation`1.&amp;lt;ExecuteAsync&amp;gt;d__2.MoveNext() &#8212; End of stack trace from previous location where exception was thrown &#8212; at }}&lt;br/&gt;
{{ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at }}&lt;br/&gt;
{{ MongoDB.Driver.OperationExecutor.&amp;lt;ExecuteReadOperationAsync&amp;gt;d__3`1.MoveNext() &#8212; End of stack trace from previous location where exception was thrown &#8212; at }}&lt;br/&gt;
{{ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at }}&lt;br/&gt;
{{ MongoDB.Driver.MongoDatabaseImpl.&amp;lt;ExecuteReadOperationAsync&amp;gt;d__50`1.MoveNext() &#8212; End of stack trace from previous location where exception was thrown &#8212; at }}&lt;br/&gt;
{{ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at }}&lt;br/&gt;
{{ System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at}}&lt;br/&gt;
{{ MongoDB.Driver.MongoDatabaseImpl.&amp;lt;UsingImplicitSessionAsync&amp;gt;d__57`1.MoveNext() &#8212; End of stack trace from previous location where exception was thrown &#8212; at }}&lt;br/&gt;
{{ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at }}&lt;br/&gt;
{{ System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at }}&lt;br/&gt;
{{ System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()}}&lt;/p&gt;</description>
                <environment></environment>
        <key id="544446">CSHARP-2271</key>
            <summary>ObjectSerializer should support deserializing all BSON types</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="sallgeud">Chad Kreimendahl</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 May 2018 21:48:35 +0000</created>
                <updated>Thu, 10 Nov 2022 00:16:26 +0000</updated>
                            <resolved>Thu, 10 Nov 2022 00:16:26 +0000</resolved>
                                    <version>2.5</version>
                    <version>2.5.1</version>
                    <version>2.6.0</version>
                                                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1893462" author="rstam" created="Wed, 16 May 2018 22:30:20 +0000"  >&lt;p&gt;A document that has been read from the database must be able to be saved back to the database.&lt;/p&gt;

&lt;p&gt;Mapping a BSON timestamp to a .NET DateTime or an Int64 would result in the value changing when it was saved back to the database.&lt;/p&gt;

&lt;p&gt;So BsonTimestamp is the appropriate type to use.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="1893046" author="sallgeud" created="Wed, 16 May 2018 16:26:01 +0000"  >&lt;p&gt;You might also consider allowing to it cast as a &quot;long&quot;&lt;/p&gt;</comment>
                            <comment id="1893032" author="sallgeud" created="Wed, 16 May 2018 16:12:39 +0000"  >&lt;p&gt;That should work.&#160; Is there any value in converting it to a DateTime, or would that cause issues going back the other way (saving it once modified)?&lt;/p&gt;</comment>
                            <comment id="1892795" author="rstam" created="Wed, 16 May 2018 14:22:48 +0000"  >&lt;p&gt;I think what you are doing (using dynamic/object as the TResult for RunCommand) is perfectly reasonable.&lt;/p&gt;

&lt;p&gt;It&apos;s just that the original vision for ObjectSerializer was that it would only convert BsonValues to standard .NET types.&lt;/p&gt;

&lt;p&gt;Based on your use case I now believe ObjectSerializer should support all BsonValue types, even if it means using types that are in the driver instead of standard .NET types.&lt;/p&gt;

&lt;p&gt;For example, when a BSON timestamp is encountered ObjectSerializer could return an instance of BsonTimestamp.&lt;/p&gt;</comment>
                            <comment id="1892409" author="sallgeud" created="Wed, 16 May 2018 03:04:11 +0000"  >&lt;p&gt;You&apos;ve got it. That&apos;s nearly identical to our command, though the original was doing a &quot;dynamic&quot; vs an &quot;object&quot;.&#160; For some reason, it&apos;s not an issue against databases that were previously. It appears that there was a change in 3.6 that must require some compat update to trigger. 3.4 ping just returns ok. 3.6 ping returns some stats.&#160;&lt;/p&gt;

&lt;p&gt;We&apos;re not using, nor would we ever have a use for Timestamp (vs DateTime), so all of these issues would only occur for us with system calls... of which there are many. We had been just taking them as &quot;dynamic&quot; to make our lives easier. It seems as if this is now ill advised?&lt;/p&gt;</comment>
                            <comment id="1892341" author="rstam" created="Tue, 15 May 2018 23:42:15 +0000"  >&lt;p&gt;One way I can trigger this exception is:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var&#160;client&#160;=&#160;&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&#160;MongoClient();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var&#160;admin&#160;=&#160;client.GetDatabase(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;admin&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var&#160;result&#160;=&#160;admin.RunCommand&amp;lt;object&amp;gt;(&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&#160;BsonDocument(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;ping&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;,&#160;&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;)); &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;This can be worked around using &lt;b&gt;RunCommand&amp;lt;BsonDocument&amp;gt;&lt;/b&gt; instead of &lt;b&gt;RunCommand&amp;lt;object&amp;gt;&lt;/b&gt;.&lt;/p&gt;</comment>
                            <comment id="1892322" author="rstam" created="Tue, 15 May 2018 22:54:47 +0000"  >&lt;p&gt;Not sure what you mean by &quot;a simple ping command&quot;.&lt;/p&gt;

&lt;p&gt;Can you provide a code snippet that can be used to reproduce this?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="864971">CSHARP-2668</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="864971">CSHARP-2668</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|hraxcf:</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>