我希望能够使用 json_contains
进行不区分大小写的搜索。
以下是 json 示例:
[
{
"title": "foo Bar",
"author": "melaine"
},
{
"title": "incredible",
"author": "steve"
}
]
我尝试过:
SELECT json_contains('[{"title":"foo Bar", "authour": "melaine"}, {"title":"foo barius", "authour": "steve"}]', '{"title":"foo bar"}')
预期结果:1
实际结果:0
因为我搜索的是 "foo bar",但在 JSON 中的值是 "foo Bar",所以我没有找到匹配项。有没有一种方法可以使其大小写不敏感,这样我就可以找到匹配项?