parse-community / parse-community/parse-server

Add support for Mongo's Decimal128 data type

Open
#8,840 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how Parse Server currently represents Number values and handles numeric queries, then compare MongoDB Decimal128 behavior with the PostgreSQL path and SDK serialization constraints described in the issue. Done means large decimal values can be stored, queried, and returned consistently across supported backends and clients.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, postgresql
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.