Thursday, 12 September 2013

JSON Access Nested Object by Key

JSON Access Nested Object by Key

I have a JSON structure like the following and I am trying to index into
it like the following but Im getting an undefined.
JSON["Shipping No"]["Min"]
{
"Shipping No": [
{
"Min": {
"MINVALUE": "5"
}
},
{
"Max": {
"MAXVALUE": "90"
}
}
],
"Name": [],
"Transistors": [],
"Type": [
{
"Min": {
"MINVALUE": "8"
}
}
]
}
I know that
JSON["Shipping No"][0]["Min"]
works but I want to direct access it by Keys like
JSON["Shipping No"]["Min"].MINVALUE;
Any Suggestions?

No comments:

Post a Comment