Skip to content

Instantly share code, notes, and snippets.

@lokedhs
Created December 30, 2015 07:52
Show Gist options
  • Save lokedhs/826bbf479af38f1b5c9e to your computer and use it in GitHub Desktop.
Save lokedhs/826bbf479af38f1b5c9e to your computer and use it in GitHub Desktop.
(function (doc) {
return doc.type === 'user_notification' && !doc.read && doc.ping_timestamp != null ? emit(doc.ping_timestamp, [doc.user]) : null;
});
(function (key, values, rereduce) {
var result = { };
for (var value = null, _js_idx1 = 0; _js_idx1 < values.length; _js_idx1 += 1) {
value = values[_js_idx1];
for (var uid = null, _js_idx2 = 0; _js_idx2 < value.length; _js_idx2 += 1) {
uid = value[_js_idx2];
result[uid] = null;
};
};
return Object.keys(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment