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
Not really sure what I'm doing wrong.
via Zaid Humayun
No comments:
Post a Comment