You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to call the method findAll(Pageable pageable) on a MongoRepository instance with the following pageable: Pageable.unpaged(sort)
When looking at the data i saw that the sort order was ignored completely.
After digging through the sources I think the issues lies in Query.java
publicQuerywith(Pageablepageable) {
if (pageable.isUnpaged()) {
returnthis; // <--- Here the sort is being ignored
}
this.limit = pageable.toLimit();
this.skip = pageable.getOffset();
returnwith(pageable.getSort());
}
As a work around i use PageRequest.of(0, Integer.MAX_VALUE, sort) but would be nice if this could be changed as it's not something you would expect
The text was updated successfully, but these errors were encountered:
mp911de
changed the title
Mongorepository findAll(Pageable pageable) ignores Sort when using unpaged PageableMongoRepository.findAll(Pageable) ignores Sort when using unpaged PageableSep 12, 2024
I was trying to call the method
findAll(Pageable pageable)
on a MongoRepository instance with the following pageable:Pageable.unpaged(sort)
When looking at the data i saw that the sort order was ignored completely.
After digging through the sources I think the issues lies in Query.java
As a work around i use
PageRequest.of(0, Integer.MAX_VALUE, sort)
but would be nice if this could be changed as it's not something you would expectThe text was updated successfully, but these errors were encountered: