Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cursor based pagination #163

Open
bakura10 opened this issue May 9, 2014 · 3 comments
Open

Implement cursor based pagination #163

bakura10 opened this issue May 9, 2014 · 3 comments

Comments

@bakura10
Copy link
Member

bakura10 commented May 9, 2014

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
Copy link
Member

Ocramius commented May 9, 2014

You mean something like start=invoice1234?

@bakura10
Copy link
Member Author

bakura10 commented May 9, 2014

Exactly. Stripe uses "starting_after" and "ending_before"

@bakura10
Copy link
Member Author

bakura10 commented May 9, 2014

I think the idea would be to automatically create a criteria that would sort by the id, and having a gt / lt filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants