Hello I'm trying to create a pagination of my documents. My pagination is set to 10 as limit. But a function like; Var res = database.listdocuments(query.limit = 10); When I check res.total gives me the total documents of the query.
I have no issue with this. I just want to know internally has the query fetched all docs.? Can I use it to get total docs in a collection.?
When I check res.total gives me the total documents of the query.
total is the total documents in the database ignoring any such limit, up to 5000.
I just want to know internally has the query fetched all docs.?
I'm not sure what you mean
Internally has fetched only the limit which is 10
So can I use this to count documents.?
im sorry, i don't quite understand
I'm saying internally the query is okay I get the first 10 documents. But res.total is the total documents without the query.limit
But res.total is the total documents without the query.limit This is expected
So if I want to get the total number of documents can I use this while limit it to 1
sure...but the maximum total will be 5000. so if you had more than 5000, it will still only show 5000
So technically I'm not overloading the database with this query when I query and limit to 1 and get total right.?
Correct. We have that 5000 cap so that the database isn't overloaded.
[SOLVED] offset and limit issue
( offset limit error ) if i am trying to fetch more then 5k record, is there is any way to increase offset value.
use cursor-based pagination...also, it's best to create a new post instead of reviving an old post like this
Recommended threads
- Appwrite console is too heavy
The Appwrite console is too heavy And all of my services broken Any support , please
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- Increase by operators
I see appwrite have bunch of useful operators for querieng db. One more I would like to suggest is operators like increase the count of a int columns by 1,2.. ...