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
Is your feature request related to a problem? Please describe.
I wouldn't call it a problem but when we try to query a page greater than the total number of pages available the lib try to query said page and we get an empty array.
Describe the solution you'd like
I think it would be nice we the lib defaults to the last available page when this happens (or at least gives the option to).
Describe alternatives you've considered
Not sure how the implementation would be in the lib's code but I circumvented this situation in my code doing a simple check as follows.
// Check if the requested page is greater than the total number of pages for the provided limit based on our collection's document count.if(pageNumber*limitNumber>documentCountInCollection){// If the requested page is indeed greater, set the requested page to the last possible page.pageNumber=Math.ceil(documentCountInCollection/limitNumber)}
Additional context
This is something we can easily deal with in our code and I understand it's not a priority in any way but I think this behavior would be well received by the users. I'll try to implement this myself and open a pull request when I get some free time but thought would be nice to leave the issue here in case someone decides to try it before me.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I wouldn't call it a problem but when we try to query a page greater than the total number of pages available the lib try to query said page and we get an empty array.
Describe the solution you'd like
I think it would be nice we the lib defaults to the last available page when this happens (or at least gives the option to).
Describe alternatives you've considered
Not sure how the implementation would be in the lib's code but I circumvented this situation in my code doing a simple check as follows.
Additional context
This is something we can easily deal with in our code and I understand it's not a priority in any way but I think this behavior would be well received by the users. I'll try to implement this myself and open a pull request when I get some free time but thought would be nice to leave the issue here in case someone decides to try it before me.
The text was updated successfully, but these errors were encountered: