I am creating sample JSON as shown below. I want to retrieve value by using on certain condition.
Observe below line of statement:
'$.Attributes..Attribute[?(@.setcode=="x")]'
But I am unable to retrieve the value by using code.
"{
"Attributes": [
{
"Attribute": {
"setcode": "x",
"codeType": "movieType",
"AttributeGroup": [
{
"code": "Force",
"codeValueValue": "'I'"
},
{
"code": "Remain",
"codeValueValue": "'P'"
},
{
"code": "Died",
"codeValueValue": "'E'"
},
{
"code": "Renew",
"codeValueValue": "'R'"
}
]
}
},
{
"Attribute":{
"setcode": "y",
"codeType": "movietype",
"AttributeGroup": [
{
"code": "Force",
"codeValueValue": "'I'"
},
{
"code": "Remain",
"codeValueValue": "'P'"
},
{
"code": "Died",
"codeValueValue": "'E'"
},
{
"code": "Renew",
"codeValueValue": "'R'"
}
]
}
}
]
}"