title: How to access specific value from mongoose query callback?
body: <p>First a little introduction to the situation. I have a MongoDB collection filled with documents. I use a schema.statics to query a particular row</p>
  
  <pre><code>TweetSchema.statics.maxAndLimit = function(screen_name, cb) {
    this.find({
      'user.screen_name': screen_name
    }).sort({'id_str':1}).select({'id_str':1,'user.statuses_count':1,'user.screen_name':1,'_id':0}).limit(1).exec(cb);
  };
  </code></pre>
  
  <p>When the query is finished it calls the callback (cb). </p>
  
  <p>In the callback I want to bind the values to variables so I can use them later. This is what I can't seem to solve:</p>
  
  <pre><code>console.log(result) == [{id_str:'12346875',user:{statuses_count:500,screen_name:'username'}}]
  
  console.log(result.id_str) == 'undefined'
  </code></pre>
  
  <p>Same goes for:</p>
  
  <pre><code>console.log(result[0].id_str)
  </code></pre>
  
  <p>Why can I not get a specific value? The typeof(result) says 'object'. </p>
  
  <p><strong>Update per request</strong>
  My non-strict schema caused Mongoose to return a non-real javascript object. So for future reference here's the 'schema' I used:</p>
  
  <pre><code>var TweetSchema = new Schema({}, {strict: false});
  </code></pre>
  
  <p>I didn't want to define everything as it's a Twitter Timeline object and thus not always the same.</p>