complete-node-bootcamp icon indicating copy to clipboard operation
complete-node-bootcamp copied to clipboard

Pagination with mongoose unhandled doubling documents bug.

Open lawuysal opened this issue 1 year ago • 2 comments

Since MongoDB does not keep documents in proper order, querying for the different pages can cause the same documents to appear in the query results. We should use a sort before the "skip()". Here is the StackOverflow answer.

lawuysal avatar Mar 23 '24 23:03 lawuysal