Validator
Validate data input
Validation is a way to validate document. That being said, for example, if a column is declared to be an email, it should also have correct format.
DAB won't automatically validate a document. You must execute it manually using dab.validateDoc()
call.
DAB will try to validate document if:
Its schema collection (i.e:
attributes
) isn't emptyExplicitly defined in
validator
options
All validator.js method are supported:
Validator | Description |
| Check if value contains the seed |
| Check if value matches the comparison |
| Check if value is a date that's after |
| check if value contains only letters (a-zA-Z) in |
| check if value contains only letters and numbers in |
| Check if the string contains ASCII chars only |
| check if a string is base64 encoded |
| Check if value is a date that's before |
| check if a string is a boolean |
| check if the string's length (in UTF-8 bytes) falls in a range |
| check if the string is a credit card |
| check if the string is a valid currency amount. More on options |
| check if the string is a data uri format |
| check if the string represents a decimal number. More on options |
| check if the string is a number that's divisible by another |
| check if the string is an email. More on options |
| check if the string has a length of zero |
| check if the string is a fully qualified domain name. More on options |
| check if the string is a float. More on options |
| check if the string contains any full-width chars |
| check if the string contains any half-width chars |
| check if the string is a hash of type algorithm. More on algorithm |
| check if the string is a hexadecimal color |
| check if the string is a hexadecimal number |
| check if the string is an IP. |
| check if the string is an ISBN. |
Last updated