jeudi 19 février 2015

Sorting timestamp in descending order in mongodb


Product.find({
userId: data.id
},null,{ $sort :{ createdOn : -1}},function(err, products) {...});


I want to sort createdOn in desc order and am not getting the desire result


note: createdOn is a timestamp and Iam using mongodb 1.3.19


please help!!


Aucun commentaire:

Enregistrer un commentaire