LearnBoost/mongoose — Issue #717: strict: true for embedded documents
Author: timfinity
Created: 2012-02-05 06:55:54+00:00
State: open

I've noticed that `strict: true` doesn't work for embedded documents. I wasn't sure if this was by design or not.

A quick example:

```javascript
var Comments = new Schema({
title : String
, body : String
, date : Date
}, {strict: true});

var BlogPost = new Schema({
, title : String
, body : String
, comments : [Comments]
}, {strict: true});

var Post = mongoose.model('BlogPost', BlogPost);

var post = new Post();

post.title = 'Saves';
post.fake = 'Doesnt save';

post.comments.push({
title: 'Saves',
fake: 'Shouldnt save but does'
});

post.save(function(err){

});
```