update not returning the instance?
See original GitHub issueupdate method is not returning correctly the model instance (the query run correctly)
this.db.models.User.update(fields, { where: { id: 2 }, returning: true})
.then((data) => {
console.log(data[0]); // undefined
console.log(data[1]); // 1
}
I’m using mariadb 10, sequelize 3.24.3
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Sequelize Update Returning Before and After Results
afterRec doesn't return a value; it's not being set for some reason 2. The update is still executing last. I see the two...
Read more >AWS::EC2::Instance - AWS CloudFormation
If the stack update fails, AWS CloudFormation uses the old instance to roll back the stack to the previous working state. The old...
Read more >Does adding a return type to an update method violate the ...
I want the Update method to return a new instance of Employee with the updated data, but since now I can say the...
Read more >Return types for update methods in the Data interface - IBM
This table shows the return types for each update method in the Data ... When the returnClass is not an Object[] , this...
Read more >QuerySet API reference | Django documentation
Returns a new QuerySet containing objects that do not match the given lookup parameters. ... exclude() , filter() , order_by() , and update()...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Use
Thanks to @roychri who just helped me about this.
returning
is only supported by postgres , http://docs.sequelizejs.com/en/v3/api/model/#updatevalues-options-promisearrayaffectedcount-affectedrows