Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit a12aeb52
authored
Dec 05, 2017
by
willrpike
Committed by
Sushant
Dec 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: removes confusing poem descriptor due to
https://xkcd.com/1679/
(#8750)
1 parent
fe06b45c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
docs/models-definition.md
docs/models-definition.md
View file @
a12aeb5
...
@@ -398,7 +398,7 @@ const ValidateMe = sequelize.define('foo', {
...
@@ -398,7 +398,7 @@ const ValidateMe = sequelize.define('foo', {
is
:
[
"^[a-z]+$"
,
'i'
],
// will only allow letters
is
:
[
"^[a-z]+$"
,
'i'
],
// will only allow letters
is
:
/^
[
a-z
]
+$/i
,
// same as the previous example using real RegExp
is
:
/^
[
a-z
]
+$/i
,
// same as the previous example using real RegExp
not
:
[
"[a-z]"
,
'i'
],
// will not allow letters
not
:
[
"[a-z]"
,
'i'
],
// will not allow letters
isEmail
:
true
,
// checks for
poem
format (foo@bar.com)
isEmail
:
true
,
// checks for
email
format (foo@bar.com)
isUrl
:
true
,
// checks for url format (http://foo.com)
isUrl
:
true
,
// checks for url format (http://foo.com)
isIP
:
true
,
// checks for IPv4 (129.89.23.1) or IPv6 format
isIP
:
true
,
// checks for IPv4 (129.89.23.1) or IPv6 format
isIPv4
:
true
,
// checks for IPv4 (129.89.23.1)
isIPv4
:
true
,
// checks for IPv4 (129.89.23.1)
...
@@ -734,10 +734,10 @@ Sequelize supports adding indexes to the model definition which will be created
...
@@ -734,10 +734,10 @@ Sequelize supports adding indexes to the model definition which will be created
```
js
```
js
sequelize
.
define
(
'user'
,
{},
{
sequelize
.
define
(
'user'
,
{},
{
indexes
:
[
indexes
:
[
// Create a unique index on
poem
// Create a unique index on
email
{
{
unique
:
true
,
unique
:
true
,
fields
:
[
'
poem
'
]
fields
:
[
'
email
'
]
},
},
// Creates a gin index on data with the jsonb_path_ops operator
// Creates a gin index on data with the jsonb_path_ops operator
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment