couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Blakey <>
Subject Re: Does CouchDB check autogenerated document id's?
Date Sat, 03 Jan 2009 13:28:59 GMT

On 03/01/2009, at 11:42 PM, Noah Slater wrote:

> On Fri, Jan 02, 2009 at 04:52:29PM -0800, Chris Anderson wrote:
>> On Fri, Jan 2, 2009 at 4:10 PM, Matt Goodall  
>> <> wrote:
>>> 2009/1/2 Jason Davies <>:
>>>> On 2 Jan 2009, at 16:11, Paul Davis wrote:
>>>>> Also, as a random aside, why does _uuids require a POST?
>> In the normal case you would POST a document to a collection when you
>> want the server to choose the final URL. However, intermediaries have
>> a habit of retrying POSTs randomly, so when you POST and id-less  
>> Couch
>> document, occasionally duplicate documents are created. We work  
>> around
>> this by recommending PUT as the document creation method. Of course
>> clients can specify any document id they'd like to, but for
>> lightweight clients CouchDB provides the _uuids service.
>> The POST is pragmatic for cache-control reasons, but also RESTy,
>> because it exposes the service that CouchDB uses internally for
>> directing document POSTs to new ids. By using the _uuids service,
>> clients can become the part of CouchDB that would direct documents to
>> URLs in a collection.
> I don't agree and I think it should change to GET.
>  * You hint that it is to mirror the process required for the  
> creation of
>    documents. This is not how we should be designing the interface.  
>    creation is totally disjoint and should be considered separately.
>  * You mention cache-control, but nothing about GET semantics implies
>    cacheability so unless there is some major flaw with common UA
>    implementations I don't see this as a valid argument.

GET is meant to be idempotent - 

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

Hi, I'd like to do $THING. I know that $SOLUTION_A and $SOLUTION_B  
will do it very easily and for a very reasonable price, but I don't  
want to use $SOLUTION_A or $SOLUTION_B because $VAGUE_REASON and  
$CONTRADICTORY_REASON. Instead, I'd like your under-informed ideas on  
how to achieve my $POORLY_CONCEIVED_AMBITIONS using Linux, duct tape,  
an iPod, and hours and hours of my precious time.
   -- Slashdot response to an enquiry

View raw message