title: Selecting array fields from Mongoose results
body: <p>I have documents with several fields including an array of other documents. I can successfully query my target documents and fetch most fields, but I can't fetch the arrays for some reason.</p>
  
  <p>Here's a little snippet of how I'm querying documents and fetching fields:</p>
  
  <pre><code>Asset.findOne({
      project: asset.project,
      ip: asset.ip
  }, function(err, match) {
      if (err) { return next(err); }
      if (match) {
          console.log(match);
          console.log(match.project);
          console.log(match.traffic);
      });
  });
  </code></pre>
  
  <p>And here's an example of the console log:</p>
  
  <pre><code>{ __v: 0,
    project: 'test',
    traffic: 
     [ { rport: 39110,
         protocol: 'tcp',
         destination: '10.0.7.30',
         lport: 50 },
       { rport: 49123, protocol: 'tcp', source: '10.0.7.29', lport: 21 } ],
    mac: 'update',
    ip: '10.0.7.27',
    _id: 568fbd22ca70246a168d45aa }
  
  test
  
  undefined
  </code></pre>
  
  <p>As you can see <code>console.log(match)</code> gives us the whole document. This document has a <code>project</code> field which I can get with <code>match.project</code>. However <code>match.traffic</code> returns <code>undefined</code>. As you can see, there is definitely a <code>traffic</code> array field in the returned document.</p>
  
  <p><strong>How can I access arrays from my documents?</strong></p>