leepowelldev / mongoose-validator

Validators for mongoose models utilising validator.js
MIT License
378 stars 43 forks source link

usigin validator parameters #48

Closed davutkara closed 6 years ago

davutkara commented 6 years ago

Validator.js, the function is isAlphanumeric(str [, locale]).

I want to send tr_TR for locale parameter, but how can I set here

validate({ validator: 'isAlphanumeric', passIfEmpty: true, message: 'Name should contain alpha-numeric characters only' })

leepowelldev commented 6 years ago

Have you tried using the arguments property? https://github.com/leepowellcouk/mongoose-validator#optionarguments---optional