summaryrefslogtreecommitdiff
path: root/users/app/designs/user/by_alias.js
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-17 15:09:58 +0100
committerAzul <azul@leap.se>2013-01-17 15:16:53 +0100
commita8ec73a0307924610023525786bb3a9eb8b173e1 (patch)
tree16d937bfea4d18a39aad1eec86edfd4f6467d708 /users/app/designs/user/by_alias.js
parent7f7ba4f3d72104d67e9ecf839c9688c0580d4063 (diff)
unit tests passing
Diffstat (limited to 'users/app/designs/user/by_alias.js')
-rw-r--r--users/app/designs/user/by_alias.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/users/app/designs/user/by_alias.js b/users/app/designs/user/by_alias.js
new file mode 100644
index 0000000..dc8021a
--- /dev/null
+++ b/users/app/designs/user/by_alias.js
@@ -0,0 +1,8 @@
+function(doc) {
+ if (doc.type != 'User') {
+ return;
+ }
+ doc.email_aliases.forEach(function(alias){
+ emit(alias.username, 1);
+ });
+}