1 2 3 4 5 6 7 8
function(doc) { if (doc.type != 'User') { return; } doc.email_aliases.forEach(function(alias){ emit(alias.email, doc); }); }