title: Map/Reduce in CouchDB with multiple parameters?
body: <p>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:</p>
  
  <pre><code>"function(doc){
    if(doc.team_name) {
      emit(doc.team_name, doc);
    }
  }"
  </code></pre>
  
  <p>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?  </p>
  
  <p>Thanks in advance,<br>
  Ben</p>