Back

Incorrect count of offset pagination return

  • 0
  • Databases
Said H
15 Feb, 2023, 15:56

Hello, I have a situation where the pagination query misses 1 count from the record. I have 153 records in database. But, when i queried them out (with offset and limit = 100), i can only get a total of 152.

I tried both client SDK and server SDK (in case of permission issue). Both gave me the same 152 count instead of 153. Here're all the screenshots.

Would you know why is that so? Thanks.

TL;DR
User encountered an issue where pagination query is returning 152 records instead of the expected 153 records. They tried both client and server SDKs, but got the same result. They provided screenshots for reference. Solution was not provided in the thread.
Drake
15 Feb, 2023, 16:17

The second request should have an offset of 100

Said H
15 Feb, 2023, 22:09

ah, my bad. Thanks very much @Steven

VincentGe
15 Feb, 2023, 23:18

:sadge: I think I need to revisit the pagination guide

VincentGe
15 Feb, 2023, 23:19

I don't know if the current hardcoded example is the best way

VincentGe
15 Feb, 2023, 23:20

to show how it's intended to be used. Maybe we should also have programmatic examples

Said H
16 Feb, 2023, 03:14

Thanks @VincentGe. The sample in the doc is good. it is clearly using "last count." I overlooked it and went with "next count" which is similar to my other project.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more