summaryrefslogtreecommitdiff
path: root/users/app/designs/message/by_user_ids_to_show_and_created_at.js
blob: 54e460443bf48e9cb6568a3ebc3937872a5c9d27 (plain)
1
2
3
4
5
6
7
8
9
// not using at moment
// call with something like Message.by_user_ids_to_show_and_created_at.startkey([user_id, start_date]).endkey([user_id,end_date])
function (doc) {
  if (doc.type === 'Message' && doc.user_ids_to_show && Array.isArray(doc.user_ids_to_show)) {
    doc.user_ids_to_show.forEach(function (userId) {
      emit([userId, doc.created_at], 1);
    });
  }
}