Specify JSON Path
- Last UpdatedJun 25, 2024
- 1 minute read
To access b in the JSON string:
{"a": {"b":"1"}}
specify as follows:
a.b
OR
a["b"]
OR
["a"].b
OR
["a"]["b"]
To access the second item of the array b that contains value 2 in the JSON string:
{
"a": [
{
"b": "1"
},
{
"b": "2"
},
{
"b": "3"
}
]
}
specify as follows:
a.b[1]
OR
a["b"][1]
OR
["a"].b[1]
OR
["a"]["b"][1]