Let's say the json object is like :
{
"title":"<title goes here>",
"version":"1.0.0",
"name":"<name goes here>",
"features": {
"feature-id1":{
"id":"090ccd9c-8930-4aa9-9aa3-f9c8e6747a27",
"name":"feature1",
"version":"1.0.0"
}
"feature-id2":{
"id":"932twe8e-2184-4er9-5qw3-g4e9w9821w71",
"name":"feature2",
"version":"1.0.0"
}
...
}
}
I want to check whether there exists a json path/value entries (or) a nested json object in the above json data.
I have tried with
json_exists(json_column,'$.features?(@."feature-id1" == "{"id": "090ccd9c-8930-4aa9-9aa3-f9c8e6747a27","name":"feature1","version":"1.0.0"}")');
But this is giving me an error "JZN-00229: Missing parenthesis in paranthetical expression".
Can't we use json_exists() to check for json objects/arrays with values?
In Postgresql this can be achieved by using the '@>' operator : json_data->'features'->'feature-id1' @> 'provide the json value'
Is there a way to achieve the same in Oracle SQL? I'm using Oracle 19c with latest patch(19.15).