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

Commit d5e9f124 by Ali Ismayilov Committed by Sushant

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

1 parent 63d4aaa3
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 ...@@ -25,9 +25,14 @@ A second option is the model. If you pass a model the returned data will be inst
```js ```js
// Callee is the model definition. This allows you to easily map a query to a predefined model // 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 => { sequelize
// Each record will now be a instance of Project .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 ## Replacements
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!