-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: BSON
-
None
-
Fully Compatible
Currently BigDecimal is not directly serializable to bson. Users must explicitly convert BigDecimal objects to Decimal128 (or a string) and serialize those. Let's implement to_bson on BigDecimal so that the serialization is transparent.
When a BigDecimal value cannot be represented as Decimal128, serialization code should raise an exception, similarly to how e.g. Int32/Int64 are handled.