couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kinley Dorji <>
Subject Re: filtering on timestamp + aggregation on another field
Date Mon, 14 Mar 2011 13:29:25 GMT
I think you'd have to emit the timestamp as the key, then apply your filter
as a key range. Temp views should be used only for testing your code, newbie
to newbie. :)

On Mar 14, 2011 6:56 PM, "Aroj George" <> wrote:


We are couch newbies. We have the attributes timestamp and location ( a path
in the location hierarchy) on a document.

["Clinic", "beds", "2011-01-01T00:00:00Z", "India", "Maharashtra",

["Clinic", "beds", "2011-01-01T00:00:00Z", "India", "Karnataka",

["Clinic", "beds", "2011-02-01T00:00:00Z", "India", "Maharashtra",

["Clinic", "beds", "2011-02-01T00:00:00Z", "India", "Karnataka",

I need the number of beds for a location in the hierarchy like Maharashtra
filtered on time.
It's straightforward to get the number of beds grouped by location hierarchy
without a filter on timestamp by not emitting the timestamp in the map.

One option is to use a temporary view to filter on the timestamp and
aggregate on group level for the location hierarchy.
Would temporary views be a good idea here? Or is there a better solution?


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