I need to compare a string of format MM/DD/YYYY with another one in postgres on a jsonb column using sequelize.
On a regular column I would do something like
sequelize.where(sequelize.fn('date', sequelize.col('created_at'), '>=', moment().subtract(1, 'days').format('MM/DD/YYY'))),
but once the value is in JSONB I can't seem to find the way to reference it.
I tried multiple variations:
sequelize.col("data ->> 'created_at'")
sequeliez.json("data.created_at")
etc...
What is the right way to implement this?