gpt4 book ai didi

sql - sequelize.js $like 运算符中的 % 符号是什么意思?

转载 作者:行者123 更新时间:2023-12-03 22:20:02 25 4
gpt4 key购买 nike

引用:Sequelize-Docs

$like: '%hat',         // LIKE '%hat'
$notLike: '%hat' // NOT LIKE '%hat'
$iLike: '%hat' // ILIKE '%hat' (case insensitive) (PG only)
$notILike: '%hat' // NOT ILIKE '%hat' (PG only)

我试图了解/查找有关 $like 运算符中 % 定义的信息。这是专门的postgres吗? - 它可能是通配符语法,但通常不是为此保留 * 吗?

我理解它的用法是
Model.find({
where: {
$like: 'somestring'
}
})

第一印象:
它似乎不是正则表达式,也似乎与 PG 运算符(即模数)无关。任何见解将不胜感激。

最佳答案

a percent sign (%) matches any sequence of zero or more characters



例如 %hat 将匹配 thataspokathathat

引用: postgres-docs

关于sql - sequelize.js $like 运算符中的 % 符号是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50836159/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com