Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

Springboot CosmosRepository with continuation token #558

@rannoune

Description

@rannoune

We are building an API with pagination and continuation token, so that our consumer can use the continuation token for the next call. We are using CosmosRepository with spring.
This is the dependency we are using:

<dependency>
    <groupId>com.azure.spring</groupId>
    <artifactId>azure-spring-boot-starter-cosmos</artifactId>
    <version>3.1.0</version>
</dependency>

CosmosRepository code:
com.azure.core.http.rest.Page findAllBy....(..., CosmosPageRequest request)

The above code is throwing an exception:
com.azure.spring.data.cosmos.exception.CosmosAccessException: Too many results - return type interface com.azure.core.http.rest.Page is not of type Iterable but find returned 2 results] with root cause

If we use the spring Page in the return, then we won't be able to get the continuationToken

Can you please tell us how to implement Pagination with CosmosRepository and continuation token?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions