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 b72fc878
authored
Jan 08, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] docs: change findOrCreate examples to .spread()
1 parent
2127e4cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
docs/docs/models.md
docs/docs/models.md
View file @
b72fc87
...
@@ -590,7 +590,7 @@ Let's assume we have an empty database with a `User` model which has a `username
...
@@ -590,7 +590,7 @@ Let's assume we have an empty database with a `User` model which has a `username
```
js
```
js
User
User
.
findOrCreate
({
username
:
'sdepold'
},
{
job
:
'Technical Lead JavaScript'
})
.
findOrCreate
({
username
:
'sdepold'
},
{
job
:
'Technical Lead JavaScript'
})
.
then
(
function
(
user
,
created
)
{
.
spread
(
function
(
user
,
created
)
{
console
.
log
(
user
.
values
)
console
.
log
(
user
.
values
)
console
.
log
(
created
)
console
.
log
(
created
)
...
@@ -614,7 +614,7 @@ User
...
@@ -614,7 +614,7 @@ User
.
then
(
function
()
{
.
then
(
function
()
{
User
User
.
findOrCreate
({
username
:
'fnord'
},
{
job
:
'something else'
})
.
findOrCreate
({
username
:
'fnord'
},
{
job
:
'something else'
})
.
then
(
function
(
user
,
created
)
{
.
spread
(
function
(
user
,
created
)
{
console
.
log
(
user
.
values
)
console
.
log
(
user
.
values
)
console
.
log
(
created
)
console
.
log
(
created
)
...
@@ -835,7 +835,7 @@ Project.count({ where: ["id > ?", 25] }).then(function(c) {
...
@@ -835,7 +835,7 @@ Project.count({ where: ["id > ?", 25] }).then(function(c) {
### max - Get the greatest value of a specific attribute within a specific table
### max - Get the greatest value of a specific attribute within a specific table
And here is a method for getting the max value of an attribute
:
And here is a method for getting the max value of an attribute
:
f
```
js
```
js
/*
/*
...
...
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