Using sequelize
on my nodejs
web app, I want to query posts using pagination (by date). Reading sequelize
docs, they offer to use offset
and limit
.
Since I want to display the posts from new to old, I need to consider the date they were created. For example, if I limit the first query to 10 page, and before executing the second query a new post was created, the next query with offset of 10 will result a duplicate post from the last query.
How should I implement the pagination so it will support new entries?