Hi, Just a question...
I've set the AMOUNT attribute type as an intger in appwrite, why it accepts Strings ?
If i pass the number as String like this "5000" appwrite accepts it !!
TypeScript
'DatabaseId,
'CollectionId',
{
"AMOUNT": "50000"
}
);```
When using a function event to listen to any create and print the req.body the AMOUNT appears as String ?
Why the create document doesn't throw an error ?
TL;DR
Developers are wondering why the 'int' attribute in Appwrite is accepting numbers as a string. Even when passing a number as a string, such as "5000," Appwrite doesn't throw an error and accepts it. This behavior occurs when using a function event to listen to creations.
Solution: Appwrite is accepting numbers as strings due to how the Data API handles inputs. To ensure that the attribute is treated as an integer, developers should explicitly convert the string input to an integer before passing it to the 'AMOUNT' attribute.Recommended threads
- Functions Problem
Whenever I run my AI Generate through Appwrite Functions, I am getting this Call Stack AIService.generateServer (src\services\ai\gemini.ts) next (<native>) ...
- Couldnt not do appwrite push tables
Not sure why i am not able to create my tables
- Frequent 500 Internal Server Errors - Pr...
PROJECT ID: 6951f2xxxxx1ee9e750a REGION: Singapore (sgp.cloud.appwrite.io) PLAN: Pro Our production application experiences **500 Internal Server Errors** mult...