Skip to content

Instantly share code, notes, and snippets.

@lancecarlson
Created June 3, 2013 22:46
Show Gist options
  • Save lancecarlson/5702128 to your computer and use it in GitHub Desktop.
Save lancecarlson/5702128 to your computer and use it in GitHub Desktop.
function(doc, req) {
if (doc.type && doc.type == 'alert') {
return true;
}
return false;
}
@lancecarlson
Copy link
Author

When I curl, I do this:

$ curl http://localhost:5984/db/_changes?filter=ddoc/alert
{"results":[

@lancecarlson
Copy link
Author

To test, I run this:

curl -XPOST http://localhost:5984/db/_design/ddoc/_update/alert -d 'delivery_method=email'

@lancecarlson
Copy link
Author

example doc

"_id": "024dfbcdc03ebd07f49f822190ab7c7b",
   "_rev": "2-8890e0a2ed0f8748e6dd62a61669d915",
   "status": "pending",
   "created_at": 137029761028,
   "type": "alert",
   "delivery_method": "email"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment