Reputation: 1012
Say I wanted to query for Posts where the content is either like 'good' and either like 'bad', then i'd do this:
Post.findAll({
where:{
content: {
[Op.and]: {
[Op.like]: '%good%',
[Op.like]: '%bad%'
}
}
}
}
But since the object has both properties named [Op.like], the latter one will replace the one above.
So I find no way to be able to query using the same operator
Upvotes: 1
Views: 336
Reputation: 58593
I think you can do it like :
[Op.and]: [
{ [Op.like]: '%good%' } ,
{ [Op.like]: '%bad%' }
]
Upvotes: 4