title: Trying to remove a subdocument in Mongoose gives me an internal mongoose error
body: <p>I have a schema as follows (simplified):</p>
  
  <pre><code>var Permission = new Schema({
    _id: String,  // email address
    role: String  // "admin" or "member"
  });
  
  var Org = new Schema({
    name: {type: String, index: {unique: true, dropDups: true}, trim: true},
    permissions: [Permission]
  });
  </code></pre>
  
  <p>An example document would look like this:</p>
  
  <pre><code>{
    "name": "My Org",
    "permissions" : [
      {"_id" : "joe@gmail.com", "role" : "admin"},
      {"_id" : "mary@gmail.com", "role" : "member"}
    ]
  }
  </code></pre>
  
  <p>I am trying to delete one of the permissions rows, using the command <code>org.permissions.remove(req.params.email)</code>, as shown in context below:</p>
  
  <pre><code>exports.removePermissions = function(req, res) {
    var name = req.params.name;
    return Org
      .findOne({name: name})
      .select()
      .exec(function(err, org) {
        if (err) return Org.handleError(res, err);
        if (!org) return Org.handleError(res, new Error("#notfound " + name));
        org.permissions.remove(req.params.email);
        org.save(function(err, org) {
          if (err) return Org.handleError(res, err);
          else return res.send(org);
        });
      });
  };
  </code></pre>
  
  <p>When I do this, I get the following error:</p>
  
  <pre><code>TypeError: Cannot use 'in' operator to search for '_id' in joe@gmail.com
      at EmbeddedDocument.Document._buildDoc (/../node_modules/mongoose/lib/document.js:162:27)
      at EmbeddedDocument.Document (/../node_modules/mongoose/lib/document.js:67:20)
      at EmbeddedDocument (/../node_modules/mongoose/lib/types/embedded.js:27:12)
      at new EmbeddedDocument (/../node_modules/mongoose/lib/schema/documentarray.js:26:17)
      at MongooseDocumentArray._cast (/../node_modules/mongoose/lib/types/documentarray.js:62:10)
      at Object.map (native)
      at MongooseDocumentArray.MongooseArray.remove (/../node_modules/mongoose/lib/types/array.js:360:21)
      at model.Org.methods.removePermissions (/../models/org.js:159:20)
  </code></pre>
  
  <p>The only thing I can think of is that Mongoose does not support _id fields that are not ObjectID's?  This is strange, because I use these elsewhere in my code and it works fine (e.g. org.permissions.id("joe@gmail.com") works).</p>
  
  <p>Any suggestions much appreciated!</p>