couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Hinrichs - DM&T" <je...@dundeemt.com>
Subject Better way to count attachments?
Date Sat, 17 Jan 2009 00:44:28 GMT
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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message