不要怂,就是干,撸起袖子干!

You need to sign in or sign up before continuing.
Commit ed0068ae by Angelo Paolo Obispo Committed by Jan Aagaard Meier

[ci skip] docs(models-definition): fixed syntax error on code sample for validations (#5818)

1 parent 37ff8760
Showing with 3 additions and 3 deletions
......@@ -301,8 +301,8 @@ var ValidateMe = sequelize.define('foo', {
isIPv4: true, // checks for IPv4 (129.89.23.1)
isIPv6: true, // checks for IPv6 format
isAlpha: true, // will only allow letters
isAlphanumeric: true // will only allow alphanumeric characters, so "_abc" will fail
isNumeric: true // will only allow numbers
isAlphanumeric: true, // will only allow alphanumeric characters, so "_abc" will fail
isNumeric: true, // will only allow numbers
isInt: true, // checks for valid integers
isFloat: true, // checks for valid floating point numbers
isDecimal: true, // checks for any numbers
......@@ -336,7 +336,7 @@ var ValidateMe = sequelize.define('foo', {
}
}
}
})
});
```
Note that where multiple arguments need to be passed to the built-in validation functions, the arguments to be passed must be in an array. But if a single array argument is to be passed, for instance an array of acceptable strings for `isIn`, this will be interpreted as multiple string arguments instead of one array argument. To work around this pass a single-length array of arguments, such as `[['one', 'two']]` as shown above.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!