0

I am trying to understand how to implement pagination using azure-documentdb-java. As I see continuation token allows me retrieve only the next page from a query executed earlier.

Is there a way how I can return the concrete page and previous page effortlessly?

1 Answers1

0

No, Cosmos DB doesn't support (efficient) offset-based pagination. You can use OFFSET LIMIT but it's not efficient. The only efficient pagination mode is token-based. You can get previously fetched pages by memorizing the previous continuation tokens (but if the underlying data has changed, the previous pages will also change).

Mo B.
  • 5,307
  • 3
  • 25
  • 42
  • If you still stuck with it, refer: https://stackoverflow.com/questions/35117304/pagination-in-c-sharp-against-documentdb-without-skip – Artyom Danilin Dec 07 '20 at 10:32