title: Mongoose - can't access object properties?
body: <p>I am trying to access the properties of a returned MongoDB (mongoose) find.</p>
  
  <p>If I try to console log the whole object, I can see it all. But if I try to log a property, I get <code>undefined</code>. The object is there!</p>
  
  <pre><code>function getAll () {
      let d = q.defer();
  
      User.find({}, function (err, docs) {
          if (err) {
              d.reject(err);
          }
  
          for(let user of docs) {
              console.log(user); // This works!
              console.log(user.email); // This returns undefined!
          }
  
          d.resolve();
      });
  
      return d.promise;
  }
  </code></pre>
  
  <p>Any idea?
  I also tried to use JSON.parse in case it was stringified (just to make sure) but it wasn't.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So seems like I can access the result using <code>user._doc.email</code>.
  But what causes this? I don't remember having to do this before.</p>