Trying to increment an integer field on a model instance in my DB. Here is the relevant code.
models.Options.findAll({
where: {
PollId: poll_id,
name: option_to_update
}
}).then((option) => {
option.increment('votes');
res.json(option);
});
When I console.log(option), it shows as an Instance so I know it inherits from the Instance class which has an increment function as can be seen here
However, when I try to run option.increment, I get this back
Unhandled rejection TypeError: option.increment is not a function
Not really sure what I'm doing wrong.