couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Yokomizo" <daniel.yokom...@gmail.com>
Subject Re: My CouchDB feature wish number 1: partial updating
Date Wed, 07 May 2008 17:37:02 GMT
On Wed, May 7, 2008 at 10:56 AM, Ralf Nieuwenhuijsen
<ralf.nieuwenhuijsen@gmail.com> wrote:
> 2008/5/7 Daniel Yokomizo <daniel.yokomizo@gmail.com>:
>>  In REST it's necessary that PUT has paste over semantics (i.e. update
>>  or insert if doesn't exist). Using it for partial updates is
>>  incorrect. As the HTTP spec defines PUT with this semantics all the
>>  clients, proxies, etc., assume it, so we have to follow it precisely.
>>  OTOH the HTTP verbs are extensible so we can define our own verbs to
>>  do operations with other semantics. There's already a PATCH proposal
>>  allowing partial updates of resources, you can see a blog entry about
>>  the issues (from the proposal author) here:
>>  http://www.snellspace.com/wp/?p=894.
>
> This is another reason to do partial updates like:
>
> PUT couchserver/database/document/pizzas/eaten
> 20
>
> It would still be valid REST.

Yes, partial updates are nice, but they're an orthogonal concept. With
PATCH we can atomically update many parts, with partial updates (but
no PATCH) we need a BATCH mechanism to describe several operations at
once. Both are useful, PATCH expresses the default case of describing
the alterations of a single document and BATCH can be used to modify
several documents, even partial updates of some.

> Greetings,
> Ralf.

Best regards,
Daniel Yokomizo.

Mime
View raw message