【发布时间】:2022-08-03 01:18:18
【问题描述】:
在 Typeorm 查询生成器中,当我想匹配其值等于布尔值 True 的行时,语法是什么?
例如,我有这个工作代码:
await getConnection()
.createQueryBuilder()
.delete()
.from(Notification)
.where(\"id = :id\", { id: 1 })
.andWhere(\'dstOrgId = :dstOrgId\', { dstOrgId: 1001 })
.execute();
但是,如果我想匹配clicked 列的值为布尔值True 的所有行,我应该怎么写呢?
我想做类似的事情:
await getConnection()
.createQueryBuilder()
.delete()
.from(Notification)
.where(\"clicked = :x\", { x: true })
.andWhere(\"viewed = :x\", { x: false })
.execute();
但是上面的代码似乎不是很好的语法,或者“正确”的语法
标签: typescript typeorm