incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sleepnova <wanpee...@gmail.com>
Subject Re: JSON-Patch
Date Wed, 20 Apr 2011 20:55:04 GMT
A sudo patch for demonstration.

if(doc._rev=="07769cff70767095e4fb525dc9000b6e"){
   //Put your patch here
}

I think above patch would be idempotent even when add or remove an array
element based on an index.

2011/4/21 sleepnova <wanpeebaw@gmail.com>

> A patch which checks document version number might solve this problem.
> similar to a git commit log
>
>
> 2011/4/21 Aurélien Bénel <aurelien.benel@utt.fr>
>
>> Dear Paul,
>>
>> > On the other hand, there's nothing inherently wrong with the PATCH verb
>>
>> True, PATCH could be idempotent... It just depends on your patch format.
>>
>> I just had a look at your patch operations specification:
>> - When you add or remove a key/value, this is idempotent.
>> - However, when you add or remove an array element based on an index, this
>> is not.
>>
>>
>> Regards,
>>
>> Aurélien
>
>
> --
> - sleepnova
>

-- 
- sleepnova

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message