Sort by date in route


MiniMongo is not sorting by date on client using latest Meteor. How do I sort by date (inserted using new Date() ) inside of a route subscription? below code had no effect on sort order. I want the items sorted by newest date first and then the limit applied.


subscriptions: function() {
    this.itemsSub = Meteor.subscribe('items',this.findFilter(), { limit:100, sort:{createdDate:-1} });


How do you get to the documents in the collection? Are you using a helper? Or a data function in your route?


I’m thinking that it may be because new Date() instantiates a Date object, which is likely not sortable in (mini)mongo.

Have you tried, which returns an integer?