Skip to content

Instantly share code, notes, and snippets.

@Stanley
Created October 14, 2010 17:23
Show Gist options
  • Save Stanley/626606 to your computer and use it in GitHub Desktop.
Save Stanley/626606 to your computer and use it in GitHub Desktop.
curl -X PUT localhost:5984/test &&
curl -X PUT localhost:5984/test/_design/demo -d @view.json &&
curl -X PUT localhost:5984/test/1 -d '{"foo": "foo"}' &&
curl localhost:5984/test/_design/demo/_view/two
{
"language": "javascript",
"views": {
"one": {"map": "function(doc){
doc.foo = \"bar\";
emit(doc._id, null)
}"},
"two": {"map": "function(doc){
emit(doc._id, doc)
}"}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment