It's a code snippet from couch_httpd.erl
db_doc_req(#httpd{method='DELETE'}=Req, Db, DocId) ->
case extract_header_rev(Req, couch_httpd:qs_value(Req, "rev")) of
missing_rev ->
couch_httpd:send_error(Req, 412, <<"missing_rev">>,
<<"Document rev/etag must be specified to delete">>);
RevToDelete ->
{ok, NewRev} = couch_db:delete_doc(Db, DocId, [RevToDelete]),
send_json(Req, 200, {[
{ok, true},
{id, DocId},
{rev, NewRev}
]})
end;
Looks like exception will be thrown if no revision specified.
So I think _rev is mandatory parameter for DELETE.
2009/1/15 Noah Slater <[email protected]>:
> On Thu, Jan 15, 2009 at 08:36:46AM -0800, Alex Rudyk wrote:
>> Also why client may want to delete revision that is not last/current
>> revision of the document?
>
> Document revisions may not mean what you think they mean:
>
> http://wiki.apache.org/couchdb/Document_revisions
>
> Hope this helps,
>
> --
> Noah Slater, http://tumbolia.org/nslater
>