For a model with this Schema...
{
name: { type: String }
}
...the following automatically casts the provided value to a string instead of enforcing the type:
document.name = 2;
document.validate(err => {
// Err is null, document.name === '2'
})
Is there a simple way to disable this behaviour?