incubator-couchdb-user mailing list archives

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

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",
"Pune"]

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

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

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

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?

Rgds,
Aroj

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