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" <[email protected]> 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



      

Reply via email to