On 3 Jun 2009, at 21:05, Brian Candler wrote:
On Tue, Jun 02, 2009 at 05:28:37PM +0100, Michael Stillwell wrote:
Do you have to DELETE the URI then re-PUT it or is there a mechanism
to update/version the design document?
If you pass along the _rev of the *previous* version it will update
as
you expect. See:
http://wiki.apache.org/couchdb/HTTP_Document_API
"To update an existing document, you also issue a PUT request. In
this
case, the JSON body must contain a _rev property, which lets CouchDB
know which revision the edits are based on."
Otherwise, if retrieving _rev is awkward, you can DELETE and re-add.
I don't think this helps, because to DELETE a document you also need
to
provide the _rev, don't you?
Yup :) DELETE is just a special case of a document update, the same
rules
for _revs do apply.
Cheers
Jan
--