title: can't call map function on an array of objects in express with mongoose
body: <p>On calling .map on an array of objects, it's throwing an error of TypeError: friends.map is not a function.</p>
  
  <p>when I do it in vanilla js with the object, it works fine, but that's after I enclose the id and _id values in quotes.</p>
  
  <p>is that the cause as it's of type ObjectId in Mongoose? if so, how do I fix it?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>var UserSchema = new Schema({
    username   : String,
    firstName  : String,
    lastName   : String
   friends    : [{ id: { type: Schema.Types.ObjectId, ref: 'User'}, status: Number }]
  });
  
  app.get('/getFriends', requireLogin, function(req, res) {
    User.findOne({ _id: req.user.id }, 'friends')
    .populate({
      path: 'friends.id',
      model: 'User',
      select: 'username firstName lastName -_id'
    })
    .exec(function(err, friends) {
      console.log(typeof(friends))
      console.log(friends)
      friends = friends.map(function(v) {
        delete(v._id);
        delete(v.status);
        return v;
      });
      res.json(friends);
    }) 
  })
  
  
  events.js:163
        throw er; // Unhandled 'error' event
        ^
  
  TypeError: friends.map is not a function</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>the output of console.log(friends)
  
  [ { _id: 590bbb88858367c9bb07776e,
      status: 2,
      id: 590bba9c858367c9bb077759 },
    { _id: 590bbb95858367c9bb07776f,
      status: 2,
      id: 590bbad5858367c9bb07775f },
    { _id: 590bbb9e858367c9bb077770,
      status: 2,
      id: 590bbb05858367c9bb077765 },
    { _id: 590bbbaa858367c9bb077771,
      status: 2,
      id: 590bbaf2858367c9bb077763 },
    { _id: 590bbbb6858367c9bb077772,
      status: 2,
      id: 590bbae5858367c9bb077761 },
    { _id: 590bbbc5858367c9bb077773,
      status: 2,
      id: 590bbabe858367c9bb07775d },
    { _id: 590bbbef858367c9bb077774,
      status: 2,
      id: 590bbab2858367c9bb07775b } ]</code></pre>
  </div>
  </div>
  </p>