couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: http PATCH support?
Date Mon, 30 Jul 2012 15:28:20 GMT
On 30 July 2012 17:20, Benoit Chesneau <bchesneau@gmail.com> wrote:
> what woul do this patch?
>
> On Sunday, July 29, 2012, Gregor Martynus wrote:
>
>> As suggested by @dch__ [1], I repeat my question in the dev mailing list.
>> I'm just wondering why there is no support for http PATCH besides the PUT?
>> Is there a reason for that, or maybe plans to add it?
>>
>> I know that you can easily use _design updates to achieve a similar thing,
>> but I think it would be a nice improvement to CouchDB's RESTful interface,
>> wouldn't it?
>>
>> [1] https://twitter.com/dch__/status/229640005155438592
>>
>> --
>> Gregor Martynus

I think Gregor's got something like this in mind?

given:

doc_rev1  = { key: "value", otherkey: "more_values", morekeys: … }

and

    PATCH /db/doc with a suitably stringified {key: "less_value"}

then

doc_rev2 = { key: "less_value", otherkey: "more_values", morekeys: … }

but what should be the correct output of:

    PATCH /db/doc with {key: null}

either:

doc_rev3 = { otherkey: "more_values", morekeys: … }

or:

doc_rev3 = { key: null, otherkey: "more_values", morekeys: … }

I would expect the latter, ie DELETEing an object would require
PATCHing the parent object.

Any other corner cases?

A+
Dave

Mime
View raw message