Put list documents in a loop until you don't have any documents left
So there isnt any way to surpass the 25 documents limit?
Btw, you don't need to await each delete
Before version 1.3, the maximum limit is 100. After that, you can set some high number, but it's still good to paginate/do it in chunks
Got it, for my frontend im using pagination
Also, how can i change that limit?
The limit query: https://appwrite.io/docs/databases-queries
Got it thanks a lot
[SOLVED] Code to clear database
It is specified in docs 🤔
Only on the queries docs for the limit query, right? But if I'm only looking at the list documents API, it's not there and I'd have to dig in a bit before finding out of the default limit.
Before, when we had limit as a param, it was much more apparent. Now, it's kind of hidden away
Yes, true
🤣 For DX, it's basically a choice.
For discoverability, force them to provide the limit ever single time does this. Otherwise we'd have to rely on them reading docs.
A possibility is to just add this information in the return object:
{
"total": 25,
"limit": 25,
"offset": whatever,
"other_stuff": wejrk,
"documents": [
{
"$id": "5e5ea5c16897e",
"$collectionId": "5e5ea5c15117e",
"$databaseId": "5e5ea5c15117e",
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"$updatedAt": "2020-10-15T06:38:00.000+00:00",
"$permissions": [
"read(\"any\")"
]
}
]
}
But my honest opinion is that long term this is just a quirk they should have to learn 😅 I feel like every framework has a few. We can make it easier with better docs + hinting
The other extreme option is to basically have no limit by default
Docs is fine to me, but it's just a little hidden right now
And be like SQL
where the default behavior is as expected, literally no limit and it just crashes your terminal if you try to select * from BIG_DATA_LAKE
LOL
😅 I feel like we can probably show that we requested up to x objects and y objects were returned
That would offer a hint
The most confusing part is "total"
total of what?
The entire DB?
The entire collection?
Recommended threads
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- Appwrite 1.9.0 doctor fails tho database...
So i was testing in a local environment the upgrade for 1.9.0, and after getting everything into a running state, i checked the logs that shows : ``` └── Cre...