Skip to content

Commit

Permalink
DOCSP-44196 - NaN/Infinity serialization exception (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
mongoKart authored Oct 11, 2024
1 parent 543e9c2 commit d3539ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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.

0 comments on commit d3539ef

Please sign in to comment.