I wanted to implement pagination in my application. As I understand it, for scrolling pagination I should use "Cursor pagination", which is a nicer solution in most cases. However, in my application, I need the ability for the user to "jump" a few pages further. So if I understand correctly I should use:" Offset pagination". However, I have a problem understanding how to display the number of available pages before. Is there any way to get the amount of all the documents in the collection without downloading them first?
Is there any way to get the amount of all the documents in the collection without downloading them first?
I would suggest maintaining this count yourself in a metadata collection.
Otherwise, for now, you can use list documents, pass a really high limit, and select a single small attribute. Then, check the length of documents. The problem with this is it will get slower as the count gets higher
Recommended threads
- Which flutter SDK version for Self Hoste...
Hi all, Is there a good way to figure out which version of flutter SDK and Dart SDK is current for latest available self-hosted 1.8.0 ? I know new features are...
- Bug Report: Crash when trying to createR...
https://github.com/appwrite/sdk-for-android/issues/96 I think the bug is related with this one https://discord.com/channels/564160730845151244/1443887021314539...
- redirect_uri errors on flutter client
Hi all, I'm using the flutter client for my app to do appwrite auth and use the JWTs to send to my backend. When I try to sign in with SSO, I get this: https:/...