title: Mongo - possible in query to project subfield to top level?
body: <p>Document is e.g.</p>
  
  <pre><code>{ username : 'Fred', address : [ {country : 'USA'}, {country : 'Canada'}] }
  { username : 'James', address : [ {country : 'Canada'}, {country : 'Vietnam'}] }
  { username : 'Sally', address : [ {country : 'Vietnam'}] }
  { username : 'Alice', address : [ {country : 'USA'}] }
  </code></pre>
  
  <p>I want to query any records with an address in north America ie. Canada or USA, and return the location that matches as a top level element of the document.</p>
  
  <p>The closest I have found to run the query is this, which returns the whole address document for the first record that matches:</p>
  
  <pre><code>coll.find(
  {address: {$elemMatch : {country : {$in : ['USA', 'Canada']}}},
  {'username': 1, 'address.$' :1 }
  )
  </code></pre>
  
  <p>returns e.g.</p>
  
  <pre><code>{ username : 'Fred', address : [ {country : 'USA'} ] }
  </code></pre>
  
  <p>But is there a way to project the country directly into the document? ie.</p>
  
  <pre><code>{ username : 'Fred', address.country : 'USA' }
  </code></pre>
  
  <p>ideally something like <code>'address.$.country'</code> (but this doesn't seem to work). Neither does <code>'address.$.0.country'</code>..</p>