title: TypeError: Cannot use 'in' operator to search for '_id' in [{}]
body: <p>I have a model created as follows</p>
  
  <pre><code>var AddressSchema = new Schema({
    category: {type: String,  default: 'home'},
    lines: {type: String },
    city: {type: String}  
  });
  
  
  /**
   * Employee Schema
   */
  var EmployeeSchema = new Schema({
    created: {
      type: Date,
  
      default: Date.now
    },
    name: {
      type: String,
      required: true,
      trim: true
    },
    address: [AddressSchema],
    user: {
      type: Schema.ObjectId,
      ref: 'User'
    }
  });
  </code></pre>
  
  <p>Following is the code in controller.js</p>
  
  <pre><code>exports.create = function(req, res) {
    console.log('in create');
    var employee = new Employee(req.body);
    employee.user = req.user;
    var address = new Address(req.body.address);
    employee.address = [address];
    console.log(employee);
    console.log(req.body);
  
    employee.save(function(err) {
      if (err) {
          console.log(err);
  
        return res.status(500).json({
          error: 'Cannot save the employee'
        });
      }
      res.json(employee);
  
    });
  };
  </code></pre>
  
  <p>Log written in my console is </p>
  
  <pre><code>{ user: 5493dabf682b42be6af784b1,
    name: 'santhu',
    _id: 5495010203fa1e000068808b,
    address: [ { _id: 5495010203fa1e000068808c, category: 'home' } ],
    created: Sat Dec 20 2014 10:24:26 GMT+0530 (IST) }
  { name: 'santhu', address: '{}' }
  [TypeError: Cannot use 'in' operator to search for '_id' in {}]
  </code></pre>
  
  <p>Why am I getting this error? I searched for this error and it happens when I try to save string when it expects object. I am saving proper object as you can see in logs. Why am I still facing this problem?</p>