Value validation
const entitySchema = new Schema({
email : { validate: 'isEmail' },
website: { validate: 'isURL '},
color : { validate: 'isHexColor' },
...
});const entitySchema = new Schema({
// ...
ip : {
validate: {
rule: 'isIP',
args: [4]
},
}
});Custom validation function
Valid values
Last updated
Was this helpful?