complete-node-bootcamp
complete-node-bootcamp copied to clipboard
Pagination with mongoose unhandled doubling documents bug.
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.