import { isEmail } from 'validator'; // ... const EmailSchema = new Schema({ email: { //... other setup validate: [ isEmail, 'invalid email' ] } });