Implement cursor based pagination
bakura10 opened this issue · 3 comments
bakura10 commented
While working on Stripe API a lot, they have implemented a type of pagination I was unaware of: cursor based pagination. The idea is that normal pagination (using limit, offset...) is unreliable because if new records are insreted while you paginate, you may miss records.
Cursor based assume that you pass the last id of the records, so that pagiantion continue just after this record.
I'm not sure if that can be implemented easily in ZfrRest but that would be a nice addition :p.
Ocramius commented
You mean something like start=invoice1234
?
bakura10 commented
Exactly. Stripe uses "starting_after" and "ending_before"
bakura10 commented
I think the idea would be to automatically create a criteria that would sort by the id, and having a gt / lt filter.