couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aroj George <>
Subject filtering on timestamp + aggregation on another field
Date Mon, 14 Mar 2011 12:56:22 GMT

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