couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: _rev or rev...? Did I see that right?
Date Thu, 30 May 2013 19:44:26 GMT
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.


On 30 May 2013 20:27, Scott Weber <> 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

View raw message