couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <kocol...@apache.org>
Subject Re: _rev or rev...? Did I see that right?
Date Fri, 31 May 2013 18:01:15 GMT
It's a wart for sure.  I still get it wrong from time to time.

Adam

On May 30, 2013, at 5:00 PM, Scott Weber <scotty2541@sbcglobal.net> wrote:

> I concur with Mark that it would be a bummer.
> 
> I understand the desire to remove potential conflicts of 'id' and 'rev', which 
> is probably why they were 'name mangled' in C-style.
> 
> But if the PUT request used the same name mangling, the meta data would be 
> consistently obtained.
> 
> Every language has reserved words. Every developer/user needs to live with it. 
> I'd just prefer that they were the same.
> 
> -Scotty
> 
> 
> 
> 
> ----- Original Message ----
> From: Mark Hahn <mark@hahnca.com>
> To: user@couchdb.apache.org
> Sent: Thu, May 30, 2013 3:01:47 PM
> Subject: Re: _rev or rev...? Did I see that right?
> 
>> for a future version where couchdb's metadata is not intertwined with
> user data at all.
> 
> That would be a bummer.  It is very convenient to just pass the doc around
> and use/set _id everywhere.  We'd have to carry around extra metadata.
> 
> On Thu, May 30, 2013 at 12:44 PM, Robert Newson <rnewson@apache.org> wrote:
> 
>> It is confusing, but this is the designed behavior. _id and _rev are
>> used where they could conflict with user-specified properties, which
>> is basically whenever you're viewing a document. In other contexts,
>> like the JSON that CouchDB responds with to indicate success or
>> failure of a PUT request, it uses "id" and "rev".
>> 
>> There's a ticket, COUCHDB-1725, for a future version where couchdb's
>> metadata is not intertwined with user data at all. With that work,
>> this kind of confusion can go away.
>> 
>> B.
>> 
>> 
>> On 30 May 2013 20:27, Scott Weber <scotty2541@sbcglobal.net> wrote:
>>> Hi Gang,
>>> 
>>> I notice that if I do a PUT, the reply has a key named "rev"
>>> But if I do a GET, the key is named "_rev"
>>> 
>>> (In fact, this is a case for "id" as well )
>>> 
>>> I know the key is stored in the document, and is meant to be auto
>> generated.
>>> However, why can't the "HTTP/1.1 201 Created" reply with the key "_rev",
>>> identical to what is in the document?
>>> 
>>> The fact that there are two different key names for the same thing makes
>> code
>>> re-use and encapsulation a little more complex.
>>> 
>>> Or am I missing something.
>>> 
>>> -Scotty
>>> 
>> 
> 


Mime
View raw message