When I try to add design documents (beginning with "_") I get an error "Only reserved document ids may start with underscore." How can I add a design document?
According to the Definitive Guide, a design document like this one:
{
"_id" : "_design/example",
"views" : {
"foo" : {
"map" : "function(doc){ emit(doc._id, doc._rev)}"
}
}
}
can be added to the database named basic with a curl command like this:
curl -X PUT http://127.0.0.1:5984/basic/_design/example --data-binary @mydesign.json
Personally, I find it much easier to use CouchApp to add and manage design documents. This section of the Definitive Guide describes how to install and use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With