Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-44196 - NaN/Infinity serialization exception #251

Merged
merged 3 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion source/fundamentals/serialization/poco.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ attributes change the way that the driver serializes each property of
your POCO. This section describes some of the common
serialization-related attributes.


Serialize Read-Only Properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -195,6 +194,12 @@ For more information on valid type conversions, see the `{+language+}
Conversions Specification
<https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions>`__.

.. important:: Serializing NaN and Infinity

If you try to serialize or deserialize a floating-point
``Infinity`` or ``NaN`` value to an integral representation, the driver throws an
``OverflowException``.

Set Field Order
~~~~~~~~~~~~~~~

Expand Down
9 changes: 9 additions & 0 deletions source/upgrade/v3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,12 @@ Version 3.0 Breaking Changes

- The ``MongoClient`` constructor accepts only one ``Credential`` object instead of an
array.

- If you try to serialize or deserialize a floating-point
``Infinity`` or ``NaN`` value to an integral representation, the driver throws an
``OverflowException``. To learn more about floating-point ``Infinity`` and ``NaN``
values, see
`Double.NaN, <https://learn.microsoft.com/en-us/dotnet/api/system.double.nan?view=net-8.0#system-double-nan>`__
`Double.PositiveInfinity, <https://learn.microsoft.com/en-us/dotnet/api/system.double.positiveinfinity?view=net-8.0#system-double-positiveinfinity>`__
and `Double.NegativeInfinity. <https://learn.microsoft.com/en-us/dotnet/api/system.double.negativeinfinity?view=net-8.0#system-double-negativeinfinity>`__
on MSDN.
Loading