Jun*_*Lee 0 mysql sql node.js sequelize.js typescript
我使用打字稿续集
如何使用findOne({where: {something or something2}});
我阅读文档,我无法理解帮助我
首先,您必须导入Op:
import {Op} from "sequelize";
Run Code Online (Sandbox Code Playgroud)
然后像这样创建你的 where 子句:
findOne({where: {
value_to_find: {
[Op.or]: {
[Op.eq]: something,
[Op.eq]: something2
}
}
}})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2388 次 |
| 最近记录: |