
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
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
- Database Double Requesting Error.
I am getting error for creating new document in an collection with new ID.unique() then too getting error of existing document. When button is pressed one docum...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
