title: mongoose save embedded document
body: <p>I have the following schema:</p>
  
  <pre><code>var StorySchema = new Schema({
    title:        { type: String, required: true },
    users:        { 
                    id:        { type: Schema.ObjectId, ref: 'Users' },
                    creator:   { type: Boolean } 
                  },       
    maxlines:     { type: Number, default: '10'},
    lines:        {
                    text:       { type: String },
                    entered_at: { type: Date }, 
                    user:       {
                                  id:   { type: Schema.ObjectId, ref: 'Users' }
                                }
                  },
    created_date: { type: Date, default: Date.now }, 
    updated_date: { type: Date, default: Date.now },        
  })
  </code></pre>
  
  <p>I want to push data into <code>lines</code> and am trying to do so with the below update:</p>
  
  <pre><code> exports.update = function (req, res) {
      Stories
      .findOne({ _id: req.params.id }, function (err, story) {
              if (err) {
                  res.json(200, {
                      success: "false",
                      message: err.message
                  })
              } else {    
          story.maxlines = story.maxlines - 1
          story.lines.push ({
              text : req.body.text,
              'user.id' : req.headers.id,
              entered_at : new Date().toISOString()
          })
          story.save(function(err, story) {
                if (err) {
                  res.json(200, {
                      success: "false",
                      message: err.message
                  })
              } else if (story) {
                  res.json({
                      sucess: "true",
                      message: story
                  })
              }
          })
          }
  
      })
  
   }
  </code></pre>
  
  <p>I get an error of <code>TypeError: Object { user: {} } has no method 'push'</code>, not entirely sure how to update the lines and the user associated with the line</p>