You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Rajkumar S <ra...@gmail.com> on 2009/02/06 10:41:42 UTC
Updating a design doc using curl
Hi,
I have a design doc by name score_list which I edit using my normal
editor and use curl to upload it to couch.
curl -X PUT "http://myserver:5984/mydb/_design%2Fscore_list" -H
"Content-Type: application/json" -T score_list.js
{"ok":true,"id":"_design/score_list","rev":"528497097"}
After every update I manually copy the rev: from the curl output to
the score_list.js.
{
"_id": "_design/score_list",
"_rev": "528497097",
"language": "javascript",
"views": {
"score_list": {
"map": "function(doc) {\n emit(null, doc);\n}"
}
}
}
This is pretty tedious and error prone and I would like to just update
the design doc and not worry about having correct _rev. Is that
possible? Is there a recommended work flow for editing and updating
design docs?
with regards,
raj
Re: Updating a design doc using curl
Posted by Rajkumar S <ra...@gmail.com>.
On Fri, Feb 6, 2009 at 3:37 PM, Jan Lehnardt <ja...@apache.org> wrote:
> Check out CouchApp[1]. It's meant for full application development,
> but nobody's going to stop you using it for just managing views.
> In fact, that's what I'm doing :) It even has its own mailing list[2]
Thanks Jan, Will checkout CouchApp
raj
Re: Updating a design doc using curl
Posted by Jan Lehnardt <ja...@apache.org>.
Hi,
On 6 Feb 2009, at 10:41, Rajkumar S wrote:
> Hi,
>
> I have a design doc by name score_list which I edit using my normal
> editor and use curl to upload it to couch.
>
> [...]
>
> This is pretty tedious and error prone and I would like to just update
> the design doc and not worry about having correct _rev. Is that
> possible? Is there a recommended work flow for editing and updating
> design docs?
Check out CouchApp[1]. It's meant for full application development,
but nobody's going to stop you using it for just managing views.
In fact, that's what I'm doing :) It even has its own mailing list[2]
[1]: http://github.com/jchris/couchapp/tree/master
[2]: http://groups.google.com/group/couchapp/
Cheers
Jan
--