You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Joran Greef <jo...@sexbyfood.com> on 2009/05/20 15:43:50 UTC

_id & _revision

Hi everyone,

I have been using CouchDB as the backend for a new API-only server and  
Couch is fun!

In keeping with my old API's interface, I would like object  
representations to use "id" as their id property rather than Couch's  
_id. And the same for revision. I've added a wrapper around Couch to  
translate _id and _revision to id and revision and vice versa but it  
would be like paradise if this was available as an option.

I understand that older versions of Couch used to use "id" instead of  
"_id" and that the "_" was introduced to imply a private namespace  
specific to Couch, but in the case of id and revision, I would suggest  
that they are also elements of the public namespace and that "id" and  
"revision" would do just fine!

Thanks,

Joran Greef

Re: _id & _revision

Posted by Jan Lehnardt <ja...@apache.org>.
On 20 May 2009, at 15:43, Joran Greef wrote:

> Hi everyone,
>
> I have been using CouchDB as the backend for a new API-only server  
> and Couch is fun!
>
> In keeping with my old API's interface, I would like object  
> representations to use "id" as their id property rather than Couch's  
> _id. And the same for revision. I've added a wrapper around Couch to  
> translate _id and _revision to id and revision and vice versa but it  
> would be like paradise if this was available as an option.
>
> I understand that older versions of Couch used to use "id" instead  
> of "_id" and that the "_" was introduced to imply a private  
> namespace specific to Couch, but in the case of id and revision, I  
> would suggest that they are also elements of the public namespace  
> and that "id" and "revision" would do just fine!

CouchDB never used "id" and "rev". It's always been "_id" and "_rev".  
I don't know if making the "_" option configurable is a good idea. If  
you feel strongly about it, please open a ticket in JIRA: https://issues.apache.org/jira/browse/COUCHDB

Cheers
Jan
--