When using APIs with pagination, cosmosdb can return less number of documents than suggested pageSize.
This leads to incorrect calculation of page.getTotalPages() and page.hasNext()
Fix: We need to implement PageImpl<> interface and calculate the offset, pageSize and totalPages manually for every iteration.
When using APIs with pagination, cosmosdb can return less number of documents than suggested pageSize. This leads to incorrect calculation of
page.getTotalPages()
andpage.hasNext()
Fix: We need to implement PageImpl<> interface and calculate the
offset
,pageSize
andtotalPages
manually for every iteration.