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
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.
The text was updated successfully, but these errors were encountered:
Can you paste your code here so that i can reference it please, i have tried my code like this.query = this.query.sort({ createdAt: -1 }).skip(skip).limit(limit)
but it still give me the error, in mmy opinion i think this is the right way to get the latest data based on the descending of createdAt as Jonas set as an default value of "-createdAt" in the sort() function. Please correct me if i'm worng.
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.
The text was updated successfully, but these errors were encountered: