最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

postgresql - Sequlize - Combine array contains operator with iLike - Stack Overflow

programmeradmin0浏览0评论

Following the example from here -

Post.findAll({
  where: {
    tags: { [Op.contains]: ['popular', 'trending'] },
  },
});

How can I combine iLike compare to it ?

For example - I have this array of tags - ['foo', 'bar'] so I need something like -

Post.findAll({
  where: {
    tags: { [Op.containsWithLike]: ['%fo%'] },
  },
});

to retrieve this Post with this tags array because its elements are "iLike contains" to '%fo'

I rather a solution with any operator of Op rather than any Sequelize.literal(...) solution

发布评论

评论列表(0)

  1. 暂无评论