Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (47.6k points)

let's say I run this query in Mongoose:

Room.find({}, function(err,docs){

}).sort({date:-1});

This doesn't work!

1 Answer

0 votes
by (106k points)

To sort by date you can use the below-mentioned code:-

Blah.find({}).sort({date: -1}).execFind(function(err,docs){ });

Related questions

0 votes
1 answer
0 votes
2 answers
asked Oct 17, 2019 in Web Technology by Sammy (47.6k points)
0 votes
2 answers
0 votes
2 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...