Skip to content

Instantly share code, notes, and snippets.

@mohammed-ali-1
Created March 15, 2019 08:36
Show Gist options
  • Save mohammed-ali-1/e390d3f9725cf0001f19f432e9332fa4 to your computer and use it in GitHub Desktop.
Save mohammed-ali-1/e390d3f9725cf0001f19f432e9332fa4 to your computer and use it in GitHub Desktop.
views.json file for CouchDB
{
"_id": "_design/subscriptions",
"views": {
"host_topic_counts": {
"reduce": "_sum",
"map": "function (doc) {\n emit(doc.url + '#' + doc.topic, 1);\n}"
},
"host_topic_triggers": {
"map": "function (doc) {\n emit(doc.url + '#' + doc.topic, {trigger: doc._id, username: doc.username, password: doc.password});\n}"
},
"all": {
"map": "function (doc) {\n emit(doc._id, doc.url + '#' + doc.topic);\n}"
},
"host_triggers": {
"map": "function (doc) {\n emit(doc.url, {trigger: doc._id, username: doc.username, password: doc.password});\n}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment