如何查询具有多个条件的表?以下是两个工作的例子:
Post.findAll({ where: ['deletedAt IS NULL'] }).success()
Run Code Online (Sandbox Code Playgroud)
和
Post.findAll({ where: {topicId: req.params.id} }).success()
Run Code Online (Sandbox Code Playgroud)
然后,如果我需要结合条件,我觉得我需要做类似的事情
Post.findAll({ where: [{topicId: req.params.id}, 'deletedAt IS NULL'] }).success()
Run Code Online (Sandbox Code Playgroud)
,但它不起作用.
sequelize等待的语法是什么?
节点调试说:
DEBUG:TypeError:Object#没有方法'replace'
如果重要的话......