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

Commit 09eea2fe by Alfredo Delgado Committed by Sushant

docs(querying): model mapping for custom fields (#9688) (#10338)

1 parent d2428dd5
Showing with 8 additions and 3 deletions
......@@ -25,9 +25,14 @@ A second option is the model. If you pass a model the returned data will be inst
```js
// Callee is the model definition. This allows you to easily map a query to a predefined model
sequelize.query('SELECT * FROM projects', { model: Projects }).then(projects => {
// Each record will now be a instance of Project
})
sequelize
.query('SELECT * FROM projects', {
model: Projects,
mapToModel: true // pass true here if you have any mapped fields
})
.then(projects => {
// Each record will now be an instance of Project
})
```
## Replacements
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!