I have been paginating fetching my documents by first reading the total attribute on DocumentList . For that I put a query limit of 1 document and then use the total attribute to carry the pagination..
However, I noticed in flutter that the total attribute shows that it apparently returns the number of documents that satisfy the query, and I can confirm that it's not true. Since I can access the whole actual number of the documents using the total attribute.
In the document_list.dart file I can see the following
Plain text
final int total;```
So where is the catch?
Summary
The user is experiencing an issue with the "total" attribute in the DocumentList class. They have been using the total attribute to paginate their document fetching, but they noticed that it doesn't accurately display the number of documents that satisfy the query. They want to know if there is a catch or if they are missing something.
Solution: There might be a confusion with the term "total". The "total" attribute in the DocumentList class actually refers to the total number of documents in the query result, not just the number of documents that satisfy the query. To accurately paginate the document fetching, the user should use a different approach,
Drake
Admin
Jun 17, 2023, 15:56
Are you expecting the total to be 1 because you put a limit of 1?
Arrow
Rank 3: Container
Jun 17, 2023, 16:05
I'm just comparing the comment on the line of code against what actually happens, so yeah
Arrow
Rank 3: Container
Jun 17, 2023, 16:06
as it seems, the limit isn't included when saying matched your query