My issue arises when I pass a date
and attempt to compare it with the default createdAt
column.
where: {
createdAt: {
$eq: date
}
}
The date I am using is in string format like this: date = '2018-12-12'
The problem lies in Sequelize not just comparing the date, but also adding the time 00:00:00 to my date before comparing. This results in Sequelize generating a query like this:
WHERE `redeem_points`.`createdAt` = '2018-11-02 00:00:00';
What I'm looking for
WHERE `redeem_points`.`createdAt` = '2018-11-02';
Is there a way to achieve this using Sequelize?