0 votes
1 view
in Web Technology by (47.8k 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 (107k 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
0 votes
2 answers
asked Oct 17, 2019 in Web Technology by Sammy (47.8k points)
0 votes
2 answers
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...