sequelize 模糊查询

 Op = Sequelize.Op;

router.get('/problem/catalog/:id', async ctx => {
    let { id } = ctx.params
    ctx.body = await Problem.findAll({ where: { catalog_id: { [Op.like]: `%${id}%` } } })
})

你可能感兴趣的:(sequelize 模糊查询)