title: $unwind an object in aggregation framework
body: <p>In the MongoDB aggregation framework, I was hoping to use the $unwind operator on an object (ie. a JSON collection). Doesn't look like this is <a href="http://docs.mongodb.org/manual/reference/aggregation/#_S_unwind" rel="noreferrer">possible</a>, is there a workaround? Are there plans to implement this?</p>
  
  <p>For example, take the article collection from the aggregation <a href="http://docs.mongodb.org/manual/reference/aggregation/#_S_unwind" rel="noreferrer">documentation</a> . Suppose there is an additional field "ratings" that is a map from user -> rating. Could you calculate the average rating for each user? </p>
  
  <p>Other than this, I'm quite pleased with the aggregation framework. </p>
  
  <p>Update: here's a simplified version of my JSON collection per request. I'm storing genomic data. I can't really make genotypes an array, because the most common lookup is to get the genotype for a random person. </p>
  
  <pre><code>variants: [
  
      {
          name: 'variant1', 
          genotypes: {
  
              person1: 2,
              person2: 5,
              person3: 7,
  
          }
      }, 
  
      {
          name: 'variant2', 
          genotypes: {
  
              person1: 3,
              person2: 3,
              person3: 2,
  
          }
      }
  
  ]
  </code></pre>