title: Mongo aggregation on array elements
body: <p>I have a mongo document like </p>
  
  <pre><code>{ "_id" : 12, "location" : [ "Kannur","Hyderabad","Chennai","Bengaluru"] }
  { "_id" : 13, "location" : [ "Hyderabad","Chennai","Mysore","Ballary"] }
  </code></pre>
  
  <p>From this how can I get the location aggregation (distinct area count).
  some thing like </p>
  
  <pre><code>Hyderabad 2, 
  Kannur 1, 
  Chennai 2, 
  Bengaluru 1, 
  Mysore 1, 
  Ballary 1
  </code></pre>