Implement BigDecimal#to_bson

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • bson-4.14.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Neil Shweky (Inactive)
              Reporter:
              Oleg Pudeyev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: