couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <>
Subject Re: incremental map/reduce scope
Date Wed, 26 Mar 2008 04:36:40 GMT
On Tue, Mar 25, 2008 at 8:23 PM, Jan Lehnardt <> wrote:
>  On Mar 25, 2008, at 23:05 , Sho Fukamachi wrote:
>  > Has the community arrived at a kind of "best practise" for
>  > differentiating between record types? In the wiki using the key
>  > "type" is suggested, I am wondering how official this is. Not that
>  > it needs to be official, of course, but establishing some sort of
>  > convention is probably a good idea to get everyone on the same page.

My practice doesn't lend itself to convention directly, but has worked
well for me so far. Rather than specifying a document.type, I just use
Duck typing, like a good Rubyist. :)

For instance in a view I might say

if (doc.authors) {
... iterate through the authors and map them ...

This way documents don't have fixed types, they just have certain view
functions that apply to them. It's too soon to tell if this will
become a maintenance headache, but I think as long as my writers are
consistent, I'll do just fine with it.

Chris Anderson

View raw message