I\'m trying to save a new document in mongodb with mongoose, but I am getting ValidationError: Path \'email\' is required., Path \'passwordHash\' is required., Path \'
To solve this type of error
ValidationError: Path 'email' is required.
your email is set required in Schema, But no value is given or email field is not added on model.
If your email value may be empty set default value in model or set allow("") in validatior. like
schemas: {
notificationSender: Joi.object().keys({
email: Joi.string().max(50).allow('')
})
}
I think will solve this kind of problem.