diff options
author | Azul <azul@riseup.net> | 2017-10-17 14:08:31 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2017-10-20 08:55:56 +0200 |
commit | a96fefa7cf9f9583adf5c152c19f53c8bdeca167 (patch) | |
tree | 495f652a1a58a933280737f737d9170b19ab2f36 /puppet/modules/site_couchdb/files/designs/messages | |
parent | 2c50305985f171f80e406e5e430911cd3e9e0f07 (diff) |
webapp: update design docs for sorted invite codes
webapp#8806 needs couch design docs that allow invite codes
to be sorted by date. This updated needs to be deployed in sync
with the new webapp version.
Diffstat (limited to 'puppet/modules/site_couchdb/files/designs/messages')
-rw-r--r-- | puppet/modules/site_couchdb/files/designs/messages/Message.json | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/puppet/modules/site_couchdb/files/designs/messages/Message.json b/puppet/modules/site_couchdb/files/designs/messages/Message.json index 6a48fc4d..2cb031c6 100644 --- a/puppet/modules/site_couchdb/files/designs/messages/Message.json +++ b/puppet/modules/site_couchdb/files/designs/messages/Message.json @@ -2,14 +2,14 @@ "_id": "_design/Message", "language": "javascript", "views": { - "by_user_ids_to_show": { - "map": "function (doc) {\n if (doc.type === 'Message' && doc.user_ids_to_show && Array.isArray(doc.user_ids_to_show)) {\n doc.user_ids_to_show.forEach(function (userId) {\n emit(userId, 1);\n });\n }\n}\n", - "reduce": " function(key, values, rereduce) {\n return sum(values);\n }\n" - }, "by_user_ids_to_show_and_created_at": { "map": "// not using at moment\n// call with something like Message.by_user_ids_to_show_and_created_at.startkey([user_id, start_date]).endkey([user_id,end_date])\nfunction (doc) {\n if (doc.type === 'Message' && doc.user_ids_to_show && Array.isArray(doc.user_ids_to_show)) {\n doc.user_ids_to_show.forEach(function (userId) {\n emit([userId, doc.created_at], 1);\n });\n }\n}\n", "reduce": " function(key, values, rereduce) {\n return sum(values);\n }\n" }, + "by_user_ids_to_show": { + "map": "function (doc) {\n if (doc.type === 'Message' && doc.user_ids_to_show && Array.isArray(doc.user_ids_to_show)) {\n doc.user_ids_to_show.forEach(function (userId) {\n emit(userId, 1);\n });\n }\n}\n", + "reduce": " function(key, values, rereduce) {\n return sum(values);\n }\n" + }, "all": { "map": " function(doc) {\n if (doc['type'] == 'Message') {\n emit(doc._id, null);\n }\n }\n" } |