Answer the question
In order to leave comments, you need to log in
How to sort collections?
Hello everyone, I need to sort the collection, for this I wrote this code:
const test= await Test.find({}).sort({id: 'desc', date: 'asc'});
const test= await Test.find({}).sort(sortField);
const test= await Test.find({}).sort(sortField: sortType);
</code
Как можно решить эту проблему?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question