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:
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:
sudo appwrite databases create-integer-attribute \
--database-id "$DATABASE_ID" \
--collection-id "$COL_ID" \
--key "listOfIntegers" \
--array true \
--required true
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.
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).
MongoDb Database Breaks integer[] & bigint[]
Still happens with a BigInt, so I don't think it's a data size issue:
sudo appwrite databases create-big-int-attribute \
--database-id "$DATABASE_ID" \
--collection-id "$COL_ID" \
--key "listOfIntegers" \
--array true \
--required true
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).
Recommended threads
- Appwrite Functions cold start
Hello. I'm seeing really long cold starts on Appwrite Cloud Functions and wanted to know if this is expected. My function just authenticates the user, fetches ...
- Can create `tablesdb` event with the UI ...
When i'm trying to add an event with `tablesdb` i get an error message My event value: `tablesdb.mtg-decklist-dev.tables.queue_parsing.rows.*.create` Same err...
- Delete on cascade from Cloud Function
I'm writing a Python function that deletes a user's main row from a table in my database. This row has relationships with other tables that use cascade deletion...