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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.
- Current User is Not authorized
recreating same Thread