title: Assign _id or Object to mongoose.Schema.Types.ObjectId
body: <p>I have the schema which refers to another object.  </p>
  
  <p><strong>model/message.js</strong></p>
  
  <pre><code>var moogoose = require('mongoose');
  var Schema = moogoose.Schema;
  
  var schema = new Schema({
             .
    user: {type: Schema.Types.ObjectId, ref: 'User'}
             .
  });
  
  module.exports = moogoose.model('Message', schema);
  </code></pre>
  
  <hr>
  
  <p>Suppose <code>user</code> is the object extracted from database.<br>
  Should I assign <code>user._id</code> or <code>user</code> object to <code>user</code> property of message model. I have tried both, they yield same result that is <code>_id</code> as value of user property.  </p>
  
  <pre><code>var message = new Message({
        user: user._id,
  });
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>var message = new Message({
        user: user
  });
  </code></pre>