Azure Cosmos DB
An Azure NoSQL database service for app development.
1,798 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
We have a springboot project which is using cosmos libraries and the pageable feature of it. It was working as expected. Now, after upgrading the springboot to 3.X.X version, the pagination feature is not working.
We always get the last 3 data even though we pass diff page.
public interface BaseRepository extends CosmosRepository<Base, String>, CrudRepository<Base, String> {
@Query("select * from c where c.base=@baseId)")
Page<Base> findByBaseId(
@Param("baseId") String baseId,
Pageable pageable);
}
This the code that we are using, it was giving expected result based on the page number passed in the Paegable object. but now, it always return the latest X number data.
This is how we are initialising the Pageable :
PageRequest of(int page, int size, Sort sort)
I dont see any reasons why it shopped working? Any pointers?
@ja Thank you for reaching out.
As mentioned by Matias Quaranta https://stackoverflow.com/questions/75749614/cosmos-pagination-is-not-working-with-latest-springboot-libraries from the Azure Cosmos DB PG team.
Currently Spring Data Cosmos does not support Spring Boot 3 or Spring Data 3 -> https://github.com/Azure/azure-sdk-for-java/issues/30458
That is potentially the reason it is not working as expected when you migrated from 2.7.6 to 3.X (major version bump).
Regards,
Oury