I am wondering how to use CouchDB's map/reduce with multiple parameters. For example, if I have teams that have players with ages and genders, I assume I would do this for my map function:
"function(doc){
if(doc.team_name) {
emit(doc.team_name, doc);
}
}"
However, I am unsure how to write a reduce function to get the oldest male player on the team or the youngest female or whatever arbitrary query. Can I pass in parameters in the URL or do I have to write multiple views?
Thanks in advance,
Ben