Answer the question
In order to leave comments, you need to log in
How to get data fetch in reverse order using mongoose?
I'm trying to select data using the slice method:
const questions = await Question
.find({})
.where('reply')
.slice([-1, limit]);
Answer the question
In order to leave comments, you need to log in
const questions = await Question
.find({})
.sort({_id: -1})
.limit(100)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question