Is this possible to insert a function to a Joi validation schema which will check in the DB if the value is unique?
(The check will be done by a function that I make, inside Joi function method).
Maybe something like this:
phone: Joi.customCheck(function(v) {
let bool;
// check in DB if v is already exists, then assign the value to bool...
return bool;
}).required()
I have searched in Google and in the Joi api reference but found nothing.