title: Mongoose save an array of objects in Ref schema
body: <p>I've got the <code>Parent</code> Schema:</p>
  
  <pre><code>const parentSchema = new Schema({
     name: {
     type: String,
    },
   children: [{
      type: Schema.Types.ObjectId,
      ref: "Children"
    }]
  })
  </code></pre>
  
  <p>And this is the <code>Children</code> Schema:</p>
  
  <pre><code>const childrenSchema = Schema({
    name: {
     type: String
    },
    surname: {
     type: String
    }
  })
  </code></pre>
  
  <p>I have an incoming user register <code>POST</code> request in the following format:</p>
  
  <pre><code>{
   "name": "TEST", 
   "children" : [
      { "name":"test","surname": "test" },
      { "name":"test","surname": "test" }
   ]
  }
  </code></pre>
  
  <p>Here's the router: </p>
  
  <pre><code> router.post("/register", (req, res, next) =&gt; {
    const {name, children} = req.body;
    let newParent = newParent({
      name,
      children
     });
    newParent.save((err, result) =&gt; {
      // res.send(result) etc.
    })
   }
  </code></pre>
  
  <p>This results in the following error: </p>
  
  <p><code>Cast to Array failed for value "[ { name: 'test', surname: 'test' } ]" at path "children"</code></p>
  
  <p>How can I save all <code>children</code> and keep in the <code>ref</code> only the children <code>_id</code> so i can later <code>populate</code> the <code>Parent</code> collection?</p>