couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamyar Navidan <>
Subject newbie question: reduce/group_level
Date Sun, 06 Dec 2009 04:55:19 GMT
Reading through Couchdb: The Definitive Guide I came across this section in
chapter 06 :

In the blog app, we use group_level reduce queries to compute the count of
> comments both on a per-post and total basis, achieved by querying the same
> view index with different methods. With some array keys, and assuming each
> key has the value 1:

> ["a","b","c"]





> The reduce view:

> function(keys, values, rereduce) {

 return sum(values)


> returns the total number of rows between the start and end key. So with
> startkey=["a","b"]&endkey=["b"] (which includes the first 3 of the above
> keys) the result would equal 3.

Earlier in chapter it is stated that:

The startkey and and endkey parameters specify an inclusive range on which
> we can search.

So how come the fourth and fifth rows that satisfy endkey=["b"] condition
are not included in results? I guess I am missing something here. Can
somebody please clarify this for me.

View raw message