couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Black <...@alwaysreformed.com>
Subject Re: show/list
Date Fri, 15 Nov 2013 03:28:58 GMT
That should have been,

On 11/14/2013 09:19 PM, Tim Black wrote:
> If you
> don't want to get all the impression docs because you're only interested
> in the count, make another view for the impressions:
>
> function(doc) {
>     if (doc.type == 'impression') {
>         emit(doc.article_id, *1*); // 1 not null
>     }
> }
>
> var number_of_impressions = GET
> ...impressions_view?key=article_id&reduce=true
>
> Then query for the *article* doc separately, since you probably already know its
> _id anyway. // "article doc" not just "doc"
Tim

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message