New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embedded doc - no validation #722
Comments
your schemas are out of order. declare the embedded doc schema before passing it into the parent schema. |
Does it work for updating schemas? I put in a validator for "min characters = 2" for the Hobby.name and it works, but "unique still doesn't" |
unique is not a validator. it is a unique index. the index creation is probably failing. listen to errors on your connection to see if thats whats up. mongoose.connect(..);
mongoose.connection.on('error', console.error);
or
var db = mongoose.createConnection(..);
db.on('errro', console.error); |
Oh thats probably it then.. thanks! Is there any built-in validation for uniqueness of key:val (e.g. a unique username) for a given collection? |
no |
I'm assuming this was not intended and that I dont have errors :)
None of the Hobby validations work (unique, required (if blank string after trimming), sampleval)...
The text was updated successfully, but these errors were encountered: