neumino/thinky — pull request #123 by marshall007 (2014-09-17 23:12:38+00:00)
Title: Added enforce_extra = 'omit' option

Proposal for solving #67. When `enforce_extra` is set to `omit`, any properties not defined in the schema will be removed during validation. Example:

```js
var Model = thinky.createModel('models', {
id: String,
foo: { bar: String },
}, { enforce_extra: 'omit' });

var doc = new Model({
id: 'UUID',
foo: { bar: 'Hello', buzz: 'OMIT' },
fizz: 'OMIT'
});

doc.validate();
// doc == { id: 'UUID', foo: { bar: 'Hello' } }
```