couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Foshay <bill.fos...@noteandgo.com>
Subject Filtering by map/reduce results
Date Thu, 18 Jul 2013 03:40:52 GMT
Is it possible to filter based on aggregation results in couchdb? For example, 
say I have a map/reduce query that counts the number of reports produced 
by an employee on a given date 
 
Here's my map function
 
function(doc) 
{ 
   if(doc.employeeId && doc.type == 'Report') 
   { 
      emit([doc.reportDate, doc.employeeId], 1)
   }
}
 
and my reduce function
 
function(keys, values, rereduce) 
{
   return sum(values); 
}
 
I'm wondering if its possible to tweak this query so that I could identify only 
those employees that created more than one report on a given day (e.g. 
query where count > 1)? I appreciate any help or suggestions.
 
Thanks!
Bill


Mime
View raw message