I want:
myCollection.find({}, {sort: [['createdAt','asc']], limit: queueLength - 1}).sort([['value','desc']])
I thought I should be able to because find().sort()
appears to exist in the MongoDB documentation (ref). But Collection.find()
inside Meteor does not return a Cursor object that can call the sort function.
What is a good solution?
Currently I’m looking at using UnderscoreJS: _.sortBy(myCollection.find().fetch(), 'value').reverse();
but was hoping for something better.