Answers for "how to validate email in mongoose schema"

1

email validation in mongoose

import { isEmail } from 'validator';
// ... 

const EmailSchema = new Schema({
    email: { 
        //... other setup
        validate: [ isEmail, 'invalid email' ]
    }
});
Posted by: Guest on August-25-2020

Code answers related to "how to validate email in mongoose schema"

Browse Popular Code Answers by Language