couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Blakey <antony.bla...@gmail.com>
Subject Re: Document Updates
Date Fri, 14 Nov 2008 02:02:18 GMT

On 14/11/2008, at 10:07 AM, Noah Slater wrote:

> I think I agree that if this was to hit CouchDB it should be done  
> via the PATCH
> method, makes the most sense given the context.


You would want to allow partial updates in a bulk operation, so any  
packaging would need to be usable in that context as well. Given  
updates need to be handled separately, maybe deletions should be as  
well.

{
   "docs": [
     /* Just for backwards compatibility ... but does that matter for  
an alpha product ? */
     ... as now ...
   ],

   "PUT": [
     /* As now with docs, but not allowing "delete":true ? */
     { "_id": ..., "_rev": ..., ... }
     ...
   ],
   "PATCH": [
     { "_id": ..., "_rev": ..., deltas: [ { "replace":... }, ... ] }
     ...
   ],
   "DELETE": [
     { "_id": ..., "_rev": ... },
     ...
   ]
}

This has the benefit of (roughly) representing the HTTP methods that  
it aggregates.

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

It is no measure of health to be well adjusted to a profoundly sick  
society.
   -- Jiddu Krishnamurti



Mime
View raw message