Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Mongoose sort

// sort by "field" ascending and "test" descending
query.sort({ field: 'asc', test: -1 });

// equivalent
query.sort('field -test');
Source by mongoosejs.com #
 
PREVIOUS NEXT
Tagged: #Mongoose #sort
ADD COMMENT
Topic
Name
5+2 =