Answer the question
In order to leave comments, you need to log in
How to select from mongodb database after sorting?
Hello. tell me how to do this in mongodb?
There is a base to which is added every minute of the record.
There is a page that a person comes to and, by endless scrolling, can view the history of additions
. records are added constantly this did not work
.find({})
.sort({created_at: -1})
.skip(page > 0 ? page * onPage : 0)
.limit(onPage)
.find({})
.sort({created_at: -1})
.start({_id: startId})
.limit(onPage)
Answer the question
In order to leave comments, you need to log in
but because records are added constantly this did not work
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question