Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var messages = Messages.find({ threadId: { $in: threadIds }});
- // We found the messages. Now retrieve the last ones per thread.
- return _.map(threadIds, function(threadId) {
- console.log('Get %s', threadId);
- Messages.find({ threadId: threadId }, {
- limit: 1, sort: { createdAt: -1 }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement