Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2860

Implement BigDecimal#to_bson

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • bson-4.14.0
    • 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.

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: