incubator-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 00:31:59 GMT

On 14/11/2008, at 10:39 AM, Chris Anderson wrote:

> On Thu, Nov 13, 2008 at 3:37 PM, Noah Slater <nslater@apache.org>  
> wrote:
>>
>> I did some digging to see what else is out there:
>>
>> * http://intertwingly.net/blog/2008/02/21/APP-Level-Patch
>> * http://blog.mozilla.com/rob-sayre/2008/02/15/restful-partial-updates/
>> * http://www.snellspace.com/wp/?p=895
>> * http://lists.w3.org/Archives/Public/ietf-http-wg/2008JanMar/0316.html
>> * http://www.snellspace.com/wp/?p=902
>
> Forgive me for throwing out a loose-cannon idea, but would it be
> easiest to provide an API where the user sends a Javascript function
> to CouchDB via the PATCH method? The function could look something
> like:
>
> function(doc) {
>  doc.my_field = "new value";
>  doc.existing_array[3] = "another new value";
>  doc.new_array = ["a", "b", 3];
>  return doc;
> }

I thought that javascript wasn't part of the Couch core? JSON isn't  
javascript, and all uses of javascript *could* be replaced with e.g.  
Ruby (or my interest, Smalltalk), which is why there is a "language"  
attribute on the views.

Your proposal would change that.

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

75% of statistics are made up on the spot.



Mime
View raw message