Home>

I want to search for Date type so that I can narrow it down by the month of birth.

The database uses postgresql, and there is data stored as a date of birth in the form "2010-06-03 09:00:00+09" of type timestamp with time zone.
I want to narrow down these by birth month, and I tried to search like like the other data types like the following, but I get an error.

birth: {
  [Op.like]:'%' +'-06-' +'%'
}
SequelizeDatabaseError: operator does not exist: timestamp with time zone ~~ unknown

The search itself is possible by adding a new birth month column, but is there a way to do a like search for Date type (timestamp with time zone type), or is there another good way?

Version of each library
express: 4.17.1
sequelize: 5.21.12
pg: 8.2.1