I'm trying to get nth position value from an integer array. My Input JSON :
{
"data" : [
{
"status" : "ACTIVE" ,
"id" : 1 ,
"isEnabled" : true,
"sample" : [ 1, 2, 3, 4 ]
} ,
{
"status" : "DEACTIVATE" ,
"id" : 2 ,
"isEnabled" : false,
"sample" : [ 1, 2, 3 ]
} ,
{
"status" : "ACTIVE" ,
"id" : 3 ,
"isEnabled" : false ,
"sample" : [ 1, 2 ]
},
{
"status" : "DEACTIVATE" ,
"id" : 4 ,
"isEnabled" : true ,
"sample" : [ 1 ]
}
]
}
My input JsonPath :
$.data[?((@.status != null) && (@.isEnabled == true))].sample[0]
Expected output: [1,2,3,4]
But got: [1,1]
So how do I get my expected value in jsonpath? I am using this tool.