Skip to content
Back

MongoDb Database Breaks integer[] & bigint[]

  • 0
  • 1
  • Self Hosted
  • Functions
  • Databases
7 Aug, 2026, 16:03

I've got a table with the below column created. When I try to insert the value [-3408048000] into it, the dart sdk cloud function call is successful (no error logs in selfhosted docker). However, any attempt at loading the Rows tab in the console breaks: the UI breaks, a network request to /rows?queries... fails with error 500 ({"message":"Server Error","code":500,"type":"general_unknown","version":"1.9.6"}) and the docker logs has the below error:

TypeScript
http.request · 5.2ms · 59ffc126

  level              error
  http.method        GET
  http.path          /v1/tablesdb/:databaseId/tables/:tableId/rows
  http.response.code 500

  Error: Cannot use object of type MongoDB\BSON\Int64 as array
    at /usr/src/code/vendor/utopia-php/database/src/Database/Document.php:49
    at /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/Mongo.php:2236
    at /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/Pool.php:79
    at /usr/src/code/vendor/utopia-php/pools/src/Pools/Pool.php:229
    ... 13 more

Column CLI create command:

TypeScript
sudo appwrite databases create-integer-attribute \
            --database-id "$DATABASE_ID" \
            --collection-id "$COL_ID" \
            --key "listOfIntegers" \
            --array true \
            --required true
TL;DR
MongoDB database is breaking with integer[] and bigint[] data types. The issue persists even when using BigInt and is not related to data size. The problem arises when inserting a row with the value `[-3408048000]` via the Dart server SDK. Inserting `[-42]` works fine.
7 Aug, 2026, 16:05

I think the implication here is that -3408048000 can't fit in an integer data type, however it shouldn't break the database (only recovery I can find is to delete the entire table) and probably ought to throw an error when trying to write a number that is too large.

7 Aug, 2026, 16:10

Since the non-string data type list item writing was just fixed (https://discord.com/channels/564160730845151244/1534992967293603920/1535184001097269279) I can't test this in the console as a list, but when I create a non-list column of integer data type and create a row with -3408048000 for that column in the console, it works (saves correctly, doesn't break the table, and displays the full number for the column).

7 Aug, 2026, 17:15

MongoDb Database Breaks integer[] & bigint[]

7 Aug, 2026, 17:16

Still happens with a BigInt, so I don't think it's a data size issue:

TypeScript
sudo appwrite databases create-big-int-attribute \
            --database-id "$DATABASE_ID" \
            --collection-id "$COL_ID" \
            --key "listOfIntegers" \
            --array true \
            --required true
7 Aug, 2026, 17:19

The table doesn't appear to break until the row is inserted via the dart server sdk that has [-3408048000] for a integer or bigint data list column. I've logged the exact variable being saved to that column and it's exactly as I've described, and if I set it to [-42] it will work correctly (no breaking in the console).

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more