diff options
author | elijah <elijah@riseup.net> | 2013-11-22 11:14:52 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-11-22 11:14:52 -0800 |
commit | 7674e38867762e5f9d1d1392ccaf89f9ba621008 (patch) | |
tree | d8d865919130b5859902cbd47adf52e3fc493d59 /puppet/modules/site_couchdb/files/designs/users | |
parent | 289a00a149ac08d01b8ee638620d8c2928966fa3 (diff) | |
parent | 481e945b3c8ea6bcb1de501b925d4332b1275c2d (diff) |
Merge branch 'develop' of ssh://leap.se/leap_platform into develop
Diffstat (limited to 'puppet/modules/site_couchdb/files/designs/users')
-rw-r--r-- | puppet/modules/site_couchdb/files/designs/users/User.json | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/puppet/modules/site_couchdb/files/designs/users/User.json b/puppet/modules/site_couchdb/files/designs/users/User.json new file mode 100644 index 00000000..c500822b --- /dev/null +++ b/puppet/modules/site_couchdb/files/designs/users/User.json @@ -0,0 +1,26 @@ +{ + "_id": "_design/User", + "language": "javascript", + "views": { + "by_login": { + "map": " function(doc) {\n if ((doc['type'] == 'User') && (doc['login'] != null)) {\n emit(doc['login'], 1);\n }\n }\n", + "reduce": "_sum" + }, + "all": { + "map": " function(doc) {\n if (doc['type'] == 'User') {\n emit(doc._id, null);\n }\n }\n" + }, + "by_alias": { + "map": "function(doc) {\n if (doc.type != 'User') {\n return;\n }\n doc.email_aliases.forEach(function(alias){\n emit(alias.username, 1);\n });\n}\n", + "reduce": "function(key, values, rereduce) { return sum(values); }" + }, + "by_login_or_alias": { + "map": "function(doc) {\n if (doc.type != 'User') {\n return;\n }\n emit(doc.login, 1);\n doc.email_aliases.forEach(function(alias){\n emit(alias.username, 1);\n });\n}\n", + "reduce": "function(key, values, rereduce) { return sum(values); }" + }, + "by_created_at": { + "map": " function(doc) {\n if ((doc['type'] == 'User') && (doc['created_at'] != null)) {\n emit(doc['created_at'], 1);\n }\n }\n", + "reduce": "_sum" + } + }, + "couchrest-hash": "26adb5c9480663de3fe60d959b60a7b2" +}
\ No newline at end of file |