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
- Update row sheet not loading
After right clicking a row header and click update, the sidebar fails to load (never-ending skeleton)
- DB Relational Table Request
Hi, I'd like to suggest a rewording of the relationships between tables. - Current wording: storeOperatingDays can contain one storeId ...
- Realtime api and labels as permission
in my tables i set labels as permission and real-time capabilities stopped working. Before when i was having "any" role everything was working. Note: user have...