title: Populating array of ObjectId's in Mongoose
body: <p>My document contains a field called <code>clients</code> that is supposed to contain an array of client id's.</p>
  
  <pre><code>{
    "first_name":"Nick",
    "last_name":"Parsons",
    "email":"nick@movementstrategy.com",
    "password":"foo",
    "clients":[
      "50f5e901545cf990c500000f",
      "50f5e90b545cf990c5000010"
    ]
  }
  </code></pre>
  
  <p>My data is coming in as JSON, and I directly send it to Mongo to create a document. For some reason, <code>clients</code> is not being populated when I create, so I have to manually enter them in as strings.</p>
  
  <p>My schema is fairly simple, and defined as:</p>
  
  <pre><code>var userSchema = new Schema({
      first_name: {
          type: String,
          trim: true
      },
      last_name: {
          type: String,
          trim: true
      },  
      email: {
          type: String,
          trim: true,
          lowercase: true,
          index: true,
          unique: true,
          required: true
      },
      password: String,
      clients: [Schema.Types.ObjectId]
  });
  </code></pre>
  
  <p>From my understanding, I've defined clients correctly. But I cannot get the clients array to populate when I am doing the create. Event the raw object that gets passed to mongo looks good.</p>
  
  <pre><code>{ 
      first_name: 'Zack',
      last_name: 'S',
      email: 'zack@movementstrategy.com',
      password: 'test',
      clients: [
         '50f5e901545cf990c500000f', 
         '50f5e90b545cf990c5000010' 
      ] 
  }
  </code></pre>
  
  <p>Is there something special that I have to do to my input so that it's casted correctly?</p>