I would like to update a database record using sequelize.js and mysql2 I do not have access to the models folder or either they have not been made so is there a way to update can't find solution all solutions are that i checked are with model name dot update
var Book = db.define(‘books’, {
title: {
type: Sequelize.STRING
},
pages: {
type: Sequelize.INTEGER
}
})
Book.update(
{title: req.body.title},
{returning: true, where: {id: req.params.bookId} }
)
.then(function([ rowsUpdate, [updatedBook] ]) {
res.json(updatedBook)
})
.catch(e => console.log(e));
I would like your expert solution on that please