Generate JSONPath based on condition

Viewed 42

Json

{
    "Id": "1234",
    "AValue": {
        "qId": "ABCD",
        "aType": "DATE",
        "value": {
            "eType": "ENCRYPTED",
            "eValue": "XXXXXXX"
        }
    }

}

How to write a jsonpath expression to get eValue only if "qId in AValue is ABCD"

1 Answers

We can use conditions

$.AValue[?(@.qId =="ABCD")].value.eValue
Related