incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah Slater <>
Subject Re: Document Updates
Date Fri, 14 Nov 2008 11:53:48 GMT
On Fri, Nov 14, 2008 at 05:35:03PM +1030, Antony Blakey wrote:
> I'm not tunneling verbs, I'm just re-using the names of the methods that would
> normally be used as selectors. I wasn't implying anything more than that.
> You delete a document using the DELETE verb, yet in a bulk operation you set
> the "_deleted" special attribute. That is in effect tunneling the DELETE,
> using a different representation, within a POST.

A RESTful system should work by exchanging representations of resources.

As best I understand it, if you want to modify a resource in a way that is not a
direct update, move or delete you should use a separate media type, something
like application/diff+json if it existed. A JSON diff could include ways to
delete and update multiple documents at the same time, a bit like UNIX diff is
able to specify filenames. This could be used for single or bulk updates.

Of course, this feels very similar to your original proposal, which leaves me a
little confused. Throwing about JSON with keys such as "POST" and "DELETE" feels
very RPC-like. Perhaps the difference is the use of a separate media type.

I am eager to be corrected by any resident RESTafarians. For me, REST is a bit
like Zen. Sometimes I think I understand it totally, and other times I'm
convinced that I don't understand it at all.


Noah Slater,

View raw message