Answers for "how to validate a number in mongoose"

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 a number in mongoose"

Browse Popular Code Answers by Language