How to get a distinct count with sequelize?

前端 未结 4 2059
长发绾君心
长发绾君心 2021-02-12 02:27

I am trying to get a distinct count of a particular column using sequelize. My initial attempt is using the \'count\' method of my model, however it doesn\'t look like this is

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-12 03:20

    Looks like this is now supported in Sequelize versions 1.7.0+.

    the count and findAndCountAll methods of a model will give you 'real' or 'distinct' count of your parent model.

提交回复
热议问题