I have two collections users and items and user.profile.savedItems is an array of items saved like so: {"itemId" : "yHud5CWpdPaEc6bdc", "added" : ISODate("2014-09-12T22:28:11.738Z")}
What I am trying to do is to retrieve the items from the user profile (that part works) and to order them according to the added date.
Right now, this is the code that I have:
return {items: Items.find({_id: {$in: _.pluck(Meteor.user().profile.savedItems, 'item')}})};
I don't know if it's possible using regular mongo syntax..