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

Fixed the Getting Started Promise documentation

The previous code did not work as it tried to use the result of
findAll() as a single entity.
1 parent 7f5a251b
Showing with 2 additions and 2 deletions
...@@ -89,7 +89,7 @@ Basically a promise represents a value which will be present at some point - "I ...@@ -89,7 +89,7 @@ Basically a promise represents a value which will be present at some point - "I
```js ```js
// DON'T DO THIS // DON'T DO THIS
user = User.findAll() user = User.findOne()
console.log(user.name); console.log(user.name);
``` ```
...@@ -97,7 +97,7 @@ console.log(user.name); ...@@ -97,7 +97,7 @@ console.log(user.name);
_will never work!_ This is because `user` is a promise object, not a data row from the DB. The right way to do it is: _will never work!_ This is because `user` is a promise object, not a data row from the DB. The right way to do it is:
```js ```js
User.findAll().then(function (user) { User.findOne().then(function (user) {
console.log(user.name); console.log(user.name);
}); });
``` ```
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!