小编moh*_*bou的帖子

有没有办法在 Sequelize 4 中进行 MySQL FullText 搜索?

我正在尝试使用 Sequelize 4 生成如下查询:

SELECT * FROM authors WHERE MATCH (name, altName) AGAINST ('shakespeare');
Run Code Online (Sandbox Code Playgroud)

我曾经能够做到这一点:

Author.find({
           where: ['MATCH (name, altName) AGAINST (?)',
                  ['shakespeare']]
           })
          .then((result) => {
              console.log(result);
          });
Run Code Online (Sandbox Code Playgroud)

但是现在,升级到 Sequelize 4 后,我收到此错误:

Error: Support for literal replacements in the `where` object has been removed.
Run Code Online (Sandbox Code Playgroud)

mysql node.js sequelize.js

2
推荐指数
1
解决办法
1187
查看次数

标签 统计

mysql ×1

node.js ×1

sequelize.js ×1