If you are using the offset pagination, you have two ways:
The client know the size and the take value and your API retrieves the data using the size and the take value passed by the client
The client sends only the page, in this case, the take value is known only by the server and you need to calculate the skip value in this way β(pageNumber - 1) * takeβ. At this moment you have the skip and the take value and you can perform your query.
I think this can help you, if not, ask me more without any problem π
The second was what I was thinking of but apparently offset method is not that good for larger databases. I doubt I would hit those issues but incase I do will it just be slow or will it error out
Probably if you are using the offset method and you have more filters your where clause can generate problems. In these cases, you need to check the indexes of the tables used in your queries. In the common cases the skip and take handling in the database doesn't generate any problems of the slowness, but the where clause yes.
If you are using the offset pagination, you have two ways:
The second was what I was thinking of but apparently offset method is not that good for larger databases. I doubt I would hit those issues but incase I do will it just be slow or will it error out
Probably if you are using the offset method and you have more filters your where clause can generate problems. In these cases, you need to check the indexes of the tables used in your queries. In the common cases the skip and take handling in the database doesn't generate any problems of the slowness, but the where clause yes.
Thanks, that helps a ton, I have no where and just 1 orderBy so Offset is going to be the way I go!