incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bradford Winfrey <bradswinf...@yahoo.com>
Subject Re: Better way to count attachments?
Date Sat, 17 Jan 2009 00:51:29 GMT
I thought spidermonkey provided a __count__ method, sorry to justtjink aloud, out and about
at the moment

Sent from my iPod

On Jan 16, 2009, at 6:44 PM, "Jeff Hinrichs - DM&T" <jeffh@dundeemt.com> wrote:

I am writing a view where the number of attachments is emit'd

function(doc) {
   var cnt = 0;
   for (var att in doc._attachments){
     cnt = cnt+1;
   }
   emit(cnt,doc._attachments);
}

Is what I came up with.  Is there a more elegant solution than this?


Regards,

Jeff



      

Mime
View raw message