title: Write an array inside another array in a Mongoose Schema
body: <p>This is the Mongoose Schema:</p>
  
  <pre><code>var userschema = new mongoose.Schema({
  
     user: String,
     imagen: [{ 
  
                tags: [String],
  
             }]
  
  });
  </code></pre>
  
  <p>I'm getting the tags with this:</p>
  
  <pre><code>var bodytags = req.body.tags;
  var tags = tbags.split(" ");
  </code></pre>
  
  <p>I get the tags from req.body, and put all of them within an array. But the problems comes here:</p>
  
  <pre><code>var img = usermodel.findOne({ user: req.session.user }, function(err, user){
  
    var img = user.imagen.push({
  
       tags: undefined
  
    });
  });
  </code></pre>
  
  <p>img.tags.push(tags);</p>
  
  <p>And when, I received an error that sais <code>TypeError: Cannot call method 'push' of undefined</code>. How can I push my array of tags inside the tags' array of my Schema?</p>
  
  <p>Thank's advance!</p>
  
  <p>EDITED:</p>
  
  <p>And this would be the result of what I want:</p>
  
  <pre><code> {
  
       user: randomuser,
       imagen: [{
                  tags: ["one", "two", "three"
                }] 
  
   }
  </code></pre>
  
  <p>And, if for example, there are two imagen objects:</p>
  
  <pre><code>  {
  
       user: randomuser,
       imagen: [{
                  tags: ["one", "two", "three"]
                },
                {
  
                  tags: ["four", "five", "six"]
  
                }] 
  
   }
  </code></pre>