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

Cross partition pagination support #120

Open
avneet15 opened this issue Sep 5, 2018 · 1 comment
Open

Cross partition pagination support #120

avneet15 opened this issue Sep 5, 2018 · 1 comment

Comments

@avneet15
Copy link

avneet15 commented Sep 5, 2018

I've come across some patterns for getting paginated results from a single partition but is it possible to use the continuationToken pattern to paginate a query which spans across partitions ?

Tried paginating using pattern here:
https://guptakumartanuj.wordpress.com/2017/12/13/pagination-support-in-documentdb-using-java-sdk-api/

But the continuationToken returned null as expected, when querying across multiple partitions.

I came across an example where the .NET SDK has been used to achieve pagination, seemingly across multiple partitions, using the MaxItemCount setting in the FeedOptions, but this doesn't seem to exist in the java sdk: http://www.zoeller.us/blog/2017/7/27/paging-results-with-documentdb

Is there any equivalent to achieve this using the java sdk ?

@ausfeldt
Copy link

@avneet15 Try using FeedResponse.getQueryIterator() which will handle pagination on hasNext, assuming you set MaxItemCount in the FeedOptions.

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