sequelize / sequelize-typescript

Decorators and some other features for sequelize
MIT License
2.79k stars 282 forks source link

could't find increment static function #808

Open billyadelphia opened 4 years ago

billyadelphia commented 4 years ago

Versions

I'm submitting a ...

[x ] bug report [x ] feature request

I found no static increment function in this package. But I have search an issue about this, I found that there was a merged PR about this function #314

    const widgetStatistic = WidgetStatistic.findOne({where: {widgetUUID}});
    if (widgetStatistic) {
      widgetStatistic.increment("views", {by: 1}); //Property 'increment' does not exist on type'
    }
gzlock commented 4 years ago

you'r missing the keyword 'await'

const widgetStatistic = await WidgetStatistic.findOne({where: {widgetUUID}});
    if (widgetStatistic) {
      widgetStatistic.increment("views", {by: 1}); //Property 'increment' does not exist on type'
    }