-3
As step one locale pt-BR
to the validator.isMobilePhone
in my Mongoose schema?
According to the documentation I should use an array, something similar to the code below, but the program gives error when compiling.
phone: {
type: String,
required: [true, 'Por favor, forneça seu telefone.'],
validate: [
validator.isMobilePhone(options: ['pt-BR']),
'Favor fornecer um telefone válido.'
]
}