Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. var messages = Messages.find({ threadId: { $in: threadIds }});
  2. // We found the messages. Now retrieve the last ones per thread.
  3. return _.map(threadIds, function(threadId) {
  4. console.log('Get %s', threadId);
  5. Messages.find({ threadId: threadId }, {
  6. limit: 1, sort: { createdAt: -1 }
  7. });
  8. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement