I've set up my own SDK accessed as below
TypeScript
DB["userinfo"]["bankaccounts"]:update({
method = "equal",
attribute = "userid",
values = { 1 }
}, function(res)
print(res)
for i,v in pairs(res) do
print(v.balance)
v.balance = v.balance + 1
end
return res
end)```
I'm concerned with how on the backend I'll update the appended changes
I see I have two options after determining which values have been changed.
1. `PATCH /databases/{databaseId}/collections/{collectionId}/documents/{documentId}`
Update each document individually which I'm worried if scaled will affect the rate limit (not only by appwrite but outgoing http limitations)
2. `PATCH /databases/{databaseId}/collections/{collectionId}/documents`
Second case seems more preferable as its all done in one request, however from my knowledge there isn't any way I can accomplish as done in the example, comparing previous data.
Is there a way that I can make method 2 work or do I have to work with method 1?
TL;DR
Developers want to update multiple documents at once based on OG value. They are considering individual updates or bulk updates using API requests. Solution: Stick with method 1 to avoid rate limits while updating each document individually.Incase the context helps, the update functions at the moment lists documents with the provided query, and runs the callback functions with those results (variable res)
Recommended threads
- How to bypass the rate limit on the back...
Once a month my app has a ton of usage and I always run into the Too many requests 429 error. I am trying to optimize the queues and jobs to manage that, but a...
- [SOLVED] Appwrite Cloud and FRA cloud se...
Can anyone estimate how long this will take to resolve? I am checking status here https://status.appwrite.online/
- How to use Operator.arrayAppend on a rel...
Hi, is it possible to use any operator on a relationship column? I have a One to Many relationship column on a table and I would like to add entries to the colu...