Have you tried putting single quotes around the first param?
The following works for me.
select json.filter('{ "store": {
"bicycle": {
"color": "red",
"price": 19.95
}}}', '$');
The result is:
[{ "store": {
"bicycle": {
"color": "red",
"price": 19.95
}}}]
I also tried this:
select json.filter('{ "store": {
"bicycle": {
"color": "red",
"price": 19.95
}}}', '$.store.bicycle.color');
The result is:
["red"]
To return the colour as a string:
select json.text(json.filter('{ "store": {
"bicycle": {
"color": "red",
"price": 19.95
}}}', '$.store.bicycle.color'));
...I get:
red
If I try:
select json.text(json.filter('{ "store": {
"bicycle": {
"color": "red",
"price": 19.95
}}}', '$.store.bicycle.price'));
...I get back the price as a string:
19.95
But I can also get it back as a number:
select json.number(json.filter('{ "store": {
"bicycle": {
"color": "red",
"price": 19.95
}}}', '$.store.bicycle.price'));