Skip to content

Add support for Mongo's Decimal128 data type #8840

Open

Description

@JTPenn-EG

New Feature / Enhancement Checklist

Current Limitation

Current Parse Server "Number" data type only supports numbers up to Mongo's double data type max value

Feature / Enhancement Description

Mongo 3.4 added support for Decimal128, adding support for it would allow servers to store numbers that they couldn't store before, all while keeping all query functions still working (afaik Decimal128 supports $gt, $gte, $lt, $lte, $eq, etc...)

Implementation I think would be very straightforward, the problem with this data type that it's not natively supported in all SDKs, so Parse Server would probably need to send the Decimal128 as a string in the Response and the SDK would need to convert the string back to a BigDecimal class (probably available in all languages)

Another problem is to find another alternative for Postgres, but I am no expert in Postgres so idk..

Example Use Case

I think any app that deals with monetary values need this data type, most blockchains use uint256 (max value of 2^256-1) for value representation...

Alternatives / Workarounds

You can store big numbers using strings right now, but that doesn't support number specific query functions...

References

https://www.mongodb.com/developer/products/mongodb/bson-data-types-decimal128/
https://github.com/iriscouch/bigdecimal.js/tree/master
https://pub.dev/packages/decimal

Activity

  1. parse-github-assistant commented on Dec 25, 2023

    @parse-github-assistant

    Thanks for opening this issue!

    • 🎉 We are excited about your ideas for improvement!
  2. mtrezza commented on Dec 25, 2023

    @mtrezza
    Member

    How would you imagine to implement this? With a new { __type: "decimal128", value: "..." }? And what should the type be called, bigdecimal, decimal128,..?

  3. added
    bounty:$20Bounty applies for fixing this issue (Parse Bounty Program)
    on Mar 3, 2024
  4. added a commit that references this issue on Feb 28, 2026
    878c74c
  5. removed
    bounty:$20Bounty applies for fixing this issue (Parse Bounty Program)
    on Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions