You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been playing around with validation for most of the inputs that are going through mongoose, I'm just wondering if there is going to be at any time some built in validation within the service? That being a lot quicker since some of it would already be generated, or it being simpler to implement.
The text was updated successfully, but these errors were encountered:
I haven't got too far with it I'm currently using node-mongoose-validator where in your schemas you can add the validation quite easily.
userSchema.path('username').validate(validator.matches('^[a-zA-Z0-9_-]{3,15}$'), 'Please provide a valid username');
userSchema.path('email').validate(validator.isEmail(), 'Please provide a valid email address');
The only real task is change over all the http status codes so that they don't throw an internal error where validation is not met and to throw bad requests instead. Or does bodymen do all this for us?
I've been playing around with validation for most of the inputs that are going through mongoose, I'm just wondering if there is going to be at any time some built in validation within the service? That being a lot quicker since some of it would already be generated, or it being simpler to implement.
The text was updated successfully, but these errors were encountered: