incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <>
Subject Re: Changing rev to _rev in view results (Was: Re: newbie question #1)
Date Tue, 30 Dec 2008 00:16:51 GMT
On Mon, Dec 29, 2008 at 4:09 PM, Antony Blakey <> wrote:
> And as far as writing is concerned, using name identity for values that
> appear in multiple contexts makes it easier to write polymorphic code e.g. a
> function that extracts the document id and revision from either a view row
> or the document value (possibly) contained within.

Which is exactly the thing I like about only having _id and _rev in
documents. My being able to identify CouchDB documents by duck type is
something I've come to enjoy in my coding. I think it makes for
simpler applications in places. Splattering the world with meaningless
"_id"s and "_rev"s only makes things more complicated.

Polymorphic identity has it's place, but you really shoudn't have an
_id / _rev pair on your hands, unless you've also got the document
itself. Breaking that contract will produce muddled thinking about
Couch's MVCC.

Chris Anderson

View raw message