我有一个带有注释和用户的数据库。现在我想获取所有注释内容 = 某物或 users.name = 某物的注释。我可以使用 SQL 轻松编写此查询,但无法使用 sequlizer。
Note.findAll({
include: [
{ model: Users, where: { name: 'something' }}
]
})
预期的查询是
select * from users,notes where notes.content='something' or users.name='something'
问题是注意不在包含内所以我不能使用
where: {
'$or':{
我的问题是如何使用 sequelize 对嵌套表进行 where 或 condition