Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
A view for debugging dupe or un-sync'd client names
Browse files Browse the repository at this point in the history
  • Loading branch information
sbisbee committed Jan 9, 2014
1 parent e5c9501 commit 8663c8f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions couchapp/app.js
Expand Up @@ -35,4 +35,18 @@ ddoc.filters = {
}
};

ddoc.views = {};

ddoc.views.clientsSeenCount = {};
ddoc.views.clientsSeenCount.map = function(doc) {
if(doc.clientsSeen) {
emit('_total', null);

doc.clientsSeen.forEach(function(client) {
emit(client, null);
});
}
};
ddoc.views.clientsSeenCount.reduce = '_count';

module.exports = ddoc;

0 comments on commit 8663c8f

Please sign in to comment.