LearnBoost/mongoose — pull request #830 by regality (2012-04-13 04:38:03+00:00)
Title: Added throws option to schema

If `throws` is passed as an option to a schema, then trying
to set attributes that are not defined in the schema will throw
an error. i.e.

```javascript
var FooSchema = new mongoose.Schema({
name: {type: String}
}, {throws: true});

var Foo = mongoose.model('Foo', FooSchema);

// this will throw an error because foo is not in the schema
var foo = new Foo({name: 'hai', foo: 'bar'});
```

(This was previously srslyStrict mode, but was changed to throws).