Error: Invalid value { undefined: 'w%' }
This is my query:
results = await models.Record.findAll({
where: {
name: {
[Op.iLike]: prefix + "%", //causing problems
},
},
order: [["createdAt", "DESC"]],
limit: num,
});
name is a String field in my MySQL table.
You have an error in your SQL syntax near 'ILIKE' 'james'
. It seems the ORM converts the query to ILIKE, which is not valid.