openblocks-dev / openblocks

🔥 🔥 🔥 The Open Source Retool Alternative
https://cloud.openblocks.dev
GNU Affero General Public License v3.0
5.84k stars 353 forks source link

Unable to handle Int64 (NumberLong) from MongoDB #292

Closed RuneStone0 closed 1 year ago

RuneStone0 commented 1 year ago

If you store a number such as 1631764775259480064 in MongoDB it becomes a NumberLong object. When Openblocks query mongo the number returned will become a float and the last part of the number is zeroed out to 1631764775259480000. See screenshot for evidence. On the left: Openblocks On the right: MongoDB Compass ob-bug

neon-balcony commented 1 year ago

Hey @RuneStone0, thanks for the post! It seems that when this data gets rendered in our browser, JS cannot handle it properly. I would suggest doing a simple $toString mapping to your original request so that you can get the whole data in string format:

image
{
    "$addFields": {
      "valueInStr": {
        "$toString": "$value"
      }
    }
 }