
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
- My collection is not updating after csv ...
- How do I format an array in a CSV file t...
I want to import a CSV file to create a document on it on the AppWrite website. I have an attribute "name" of type String and "ingredients" which is of type St...
- my database attribute stuck in processin...
when i created attributes in collection 3 of those attributes become "processing", and they are not updating, the worst thing is that i cant even delete them s...
