every I use this query in sequelize:
await Sequelize.findAll({
where: {
status: '$open'
},
bind: {
open: 'open'
}
})
The query executed like this:
SELECT * FROM users WHERE status='?'
And data is not returned
You don't need to use bind params when the query is not a raw query.
const open = 'open'
await Model.findAll({
where: {
status: open
},
})
If you are using a raw query, then you may want to use replacements attribute:
await Model.sequelize.query('SELECT * FROM users WHERE status=:status', { replacements: {
status: 'open',
}
})