我有以下格式的 JSON 文档:
{
"id":"1005",
"config":{
"properties":["ABC_001", "DEF_002", "PQR_009"]
}
}
如何搜索与模式“%ABC%”匹配且 id=1005 的特定 config.properties。在上述情况下,我的输出应该是
config.properties:ABC_001
最佳答案
这让你接近:
select prop as `config.properties`
from test unnest config.properties prop
where test.id = "1005" and prop like '%ABC%'
这是输出:
[
{
"config.properties": "ABC_001"
}
]
关于json - 如何在 couchbase 数组中搜索特定字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53831000/