How to get a distinct count with sequelize?

前端 未结 3 1761
情深已故
情深已故 2021-02-12 02:45

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

3条回答
  •  半阙折子戏
    2021-02-12 03:11

    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.

提交回复
热议问题