Use Pageable.getOffset() instead of calculating it.
This commit is contained in:
@@ -102,7 +102,7 @@ abstract class MongoCursorUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int toSkip = pageable.getPageSize() * pageable.getPageNumber();
|
int toSkip = pageable.getOffset();
|
||||||
int first = pageable.getPageSize();
|
int first = pageable.getPageSize();
|
||||||
|
|
||||||
cursor.limit(first).skip(toSkip);
|
cursor.limit(first).skip(toSkip);
|
||||||
|
|||||||
Reference in New Issue
Block a user