You need to return to the raw request . Most ORM systems do not cope well with MySQL functions.
As an example for a where query:
sequelize.query("SELECT * FROM `users` WHERE FIND_IN_SET(username, 'foo,bar,baz') < 3", { type: sequelize.QueryTypes.SELECT})
.then(users => {
})
sequelize.query("SELECT FIND_IN_SET(username, 'foo,bar,baz') as `idx`, id FROM `users`", { type: sequelize.QueryTypes.SELECT})
.then(value => {
console.log(value.id + ' has an idx of ' + value.idx);
})
source
share