I have JSON values like this stored in a table:
{
"properties":[
{
"address":{
"value":"A3",
"name":"",
"prop":"",
"path":[
"RealOptionsList9293"
],
"type":"local"
},
"value":{
"type":11,
"value":"portland"
},
"dependents":[
],
"save":true
}
]
}
I'd like to index on address.value and value.value so that I can query on them. MSDN examples are for basic property using computed column. It does not cover indexing an array. Is indexing possible on array? Any example will be helpful.
I'd like to query for rows with:
JSON_VALUE(mycolumn, '$.properties[*].address.value') = 'A3'
AND JSON_VALUE(mycolumn, $.properties[*].value.value) = 'portland'
I don't see [*] syntax. Should I use OPENJSON() instead? If I use it, should I use a materialized view?