Is there any way to know if the pagination has ended? (Or if it's the last "page") When making an infinite scrolling pagination, It's needed to know if the end was reached to stop making requests and loader
Hi, are you using cursor or offset pagination right now?
@joeyouss Offset pagination
I could use cursor if needed to achieve that
So, start with a limit of 100 since that is the maximum and and an offset of 0 (the first page).
If the server returns a full page of results (eg, 100 items in this case), then increase the offset by 1 and make another request -> because there are more documents.
Continue doing this until the server returns fewer results than the limit allows (100).
this way, you know you have reached the end
Does this make sense?
you just need to see the time when less than 100 items are returned since that will be the last
Ok, that's what I was doing, but as I see, there's not another way to achieve the same
Thanks
let me just quickly confirm if there is another way too
Also I don't understand why I get 23 elements when having 21
Ok, thanks
Recommended threads
- [SOLVED] Get Relations when using Tables...
Hi there, I have a table containing a relation column with a one-to-many relationship to another table. When Using TablesDB.GetRow in "node-appwrite" i get all ...
- Transaction and Session
I've been debugging for hours a problem that now I think it's because It's not allowed: In my project a user log in using the `node-appwrite` SDK (SSR) I store...
- Push Notification FCM Error
Hello dear people. I tried to integrate Push Notifications into my Flutter App. Everything works fine on Android/iOS Simulator + Testflight but as soon as I s...