title: How to save array of objects in mongoose
body: <p>I have this data from angular</p>
  <pre><code> {
       &quot;name&quot;: &quot;Test name&quot;,
       &quot;conditions&quot;: [
          {
           &quot;id&quot;: &quot;56a53ba04ce46bf01ae2bda7&quot;,
           &quot;name&quot;: &quot;First condition&quot;             
          },
          {
           &quot;id&quot;: &quot;56a53bae4ce46bf01ae2bda8&quot;,
           &quot;name&quot;: &quot;Second condition&quot;
          }
       ],
       &quot;colors&quot;: [
          {
           &quot;id&quot;: &quot;56a545694f2e7a20064f228e&quot;,
           &quot;name&quot;: &quot;First color&quot;
          },
          {
           &quot;id&quot;: &quot;56a5456f4f2e7a20064f228f&quot;,
           &quot;name&quot;: &quot;Second color&quot;
          }
       ]
  }
  </code></pre>
  <p>and I want to save this in ProductSchema in mongoDb but I don't know how to create schema for this</p>
  <pre><code>var ProductSchema = new Schema({
      name: String,
      conditions:  [Array],
      colors: [Array]
  });
  </code></pre>
  <p>and how to save it to model in server controller</p>
  <pre><code> var product = new Products({
      name: req.body.name,
      conditions: req.body.conditions,
      colors: req.body.colors
  });
  </code></pre>
  <p>when I use this Schema and this controller I get empty record in collection except name and ObjectId. How to create right Schema and controller?</p>