i want that if the number of digits in the input field in less/more than 14(for example) then joi should return an error.
how can i do this with the type of number not for string.
Validation for 10 digit numeric mobile number are given below
joi.string().length(10).pattern(/^[0-9]+$/).required(),
You should change the rule as per your requirement. pattern(your regex) is used to accept only digits, length() is used to validate how many character validation accepts and only work with string function.