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
- Retrieving Data From Backups
Hiya, I have a user requesting for data they accidentally deleted. I don't have document history built into my app. Is there a way to extract data from the auto...
- Help
- HUGE OUTRAGE IN APPWRITE, I CANNOT ACCES...
I have 2k users trying to access, sending me messages. What am I supposed to do? Please solve this asap.