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
- 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...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...