Open elaijuh opened 4 years ago
https://github.com/feathersjs-ecosystem/feathers-sequelize/blob/165288f644e5b5a54a5dca6bcd10f4ad3d8d67ee/lib/index.js#L144
This line makes sequelize to use primary key instead of * while options.col is not defined in model beforeCount hook. That causes count on the first primary key which leads to unexpected result. I think it should be documented somewhere.
*
options.col
beforeCount
count
Just stumbled on this. Waiting for a fix, but until then try adding this to your Sequelize model (syntax as of Sequelize v4):
hooks: { beforeCount(options) { options.distinct = false; }, },
https://github.com/feathersjs-ecosystem/feathers-sequelize/blob/165288f644e5b5a54a5dca6bcd10f4ad3d8d67ee/lib/index.js#L144
This line makes sequelize to use primary key instead of
*
whileoptions.col
is not defined in modelbeforeCount
hook. That causescount
on the first primary key which leads to unexpected result. I think it should be documented somewhere.