I am trying to add a where like clause to a Node Sequelize findAll, to behave like the sql query select * from myData where name like '%Bob%' with the below code
let data: Array<any> = await MyDataSequelizeAccess.findAll({
where: {
name: {
$like: `%Bob%`
}
}
});
Which is returning the below error
Invalid value { '$like': '%Bob%' }
How can I perform that type of where wildcard or where like on my sequelize object?
let data: Array<any> = await MyDataSequelizeAccess.findAll({
where: {
name: `Bob`
}
});
This works as expected, but I cannot get the wildcard to work.
updated still no dice - per https://sequelize.readthedocs.io/en/latest/docs/querying/#operators my syntax looks correct
I'm also trying (and failing) to do the same with $not as in
let data: Array<any> = await MyDataSequelizeAccess.findAll({
where: {
name: {
$not: `Bob`
}
}
});
and getting the same error as above Invalid value { '$not': '%Bob%' }