Open thboileau opened 1 year ago
I get this error with a specific expression: loc.indexOf is not a function
loc.indexOf is not a function
Given this json payload:
{ "stores": [ { "name": "Store 1"}, { "name": "Store 2" }, { "name": "Store 3" }, { "name": "Store 4"} ] }
When I apply this path $.stores[1:4:2][(@.length-1)].name Then I get an error: loc.indexOf is not a function.
$.stores[1:4:2][(@.length-1)].name
Please note that this expression ($.stores[1:4:2]) returns:
$.stores[1:4:2]
[ { "name": "Store 2" }, { "name": "Store 4" } ]
And this expression ($.stores[(@.length-1)].name) returns:
$.stores[(@.length-1)].name
[ "Store 4" ]
There should be no error.
"Store 4"
Getting the same error on deleting an element from an array inside callback. But splice solve it.
callback
splice
Describe the bug
I get this error with a specific expression:
loc.indexOf is not a function
Code sample or steps to reproduce
Given this json payload:
When I apply this path
$.stores[1:4:2][(@.length-1)].name
Then I get an error:loc.indexOf is not a function
.Please note that this expression (
$.stores[1:4:2]
) returns:And this expression (
$.stores[(@.length-1)].name
) returns:Expected behavior
There should be no error.
Expected result
Environment (IMPORTANT)
Desktop**