I need increase document attribute for my project and I found https://github.com/appwrite/appwrite/issues/3905 and https://github.com/utopia-php/database/pull/217 but I know increment/decrease API isn't available yet. Do you have any workaround?
Hi kurosh, yes this has been a highly requested feature, let me talk to my team and fix you up with any workarounds if possible
Also
It would be great if you could share a bit more about your usecase i.e. what you are trying to do so maybe we could discuss specific workarounds
I have this open source project https://github.com/mondora/cycletowork that I used firebase services for backend and I like to used appwrite
For example each cyclist has a some of km and CO2 and every time they biking we have to increase those values
that increase have to be atomic when there are in challenge and each company have some cyclist and we have to increase those values
Awesome, thank you for elaborating
So what you could do is as a workaround that
You could create a new data point and update the document https://appwrite.io/docs/client/databases?sdk=web-default#databasesUpdateDocument with the new data, they could use looping for this so instead of incrementing or decrementing it could be an update operation given that they are processing not more than 120 requests in every 1 minutes.
Maybe a function which does the updation for you and does all the calculation .
We do not have a fix currently for this but it would be great if you upvote the issue linked to incrementation and I’ll ask my team if there’s any timeline regarding this!
unfortunately this workaround is not work for me , I hope you implement this feature as soon as possible
Recommended threads
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...
- Appwrite exception: user_unauthorized, t...
After refreshing the app it is working perfectly