title: how to group and show the counts of multiple fields in mongoose
body: <p>I have a collection in MongoDB that is generated via a data import of a CSV file. The data in the collection is for some basic reports and all the fields have been flattened and doesn't really look like a typical document.
  Here is an example of 2 documents</p>
  
  <p>{</p>
  
  <p>"schoolCode": "0001",</p>
  
  <pre><code>"name": "Special Centre",
  "ecsTaught": "N",
  "elementaryTaught": "Y",
  "juniorHighTaught": "N",
  "seniorHighTaught": "N",
  "authorityCode": "9000",
  "offerHomeEducation": "N",
  "offerHomeEducationBlended": "N",
  "offerSchoolOnline": "N",
  "offerSchoolOutreach": "N",
  "extractDate": "2015-05-11"
  </code></pre>
  
  <p>}</p>
  
  <p>{</p>
  
  <p>"schoolCode": "0002",</p>
  
  <pre><code>"name": "High point Centre",
  "ecsTaught": "y",
  "elementaryTaught": "Y",
  "juniorHighTaught": "N",
  "seniorHighTaught": "Y",
  "authorityCode": "9000",
  "offerHomeEducation": "N",
  "offerHomeEducationBlended": "N",
  "offerSchoolOnline": "N",
  "offerSchoolOutreach": "N",
  "extractDate": "2015-05-11"
  </code></pre>
  
  <p>}</p>
  
  <p>I would like to query using mongoose to get a count report as follows</p>
  
  <ul>
  <li>Ecs Taught : 20</li>
  <li>Elementatary Taught: 47</li>
  <li>JuniorHigh Taught: 55</li>
  <li>SeniorHigh Taught: 43</li>
  </ul>
  
  <p>The count should take into account, any field that has "Y" and projected as above.
  I am actually new to mongoose and have checked the docs but did not find much info on how to aggregate over multiple columns. </p>