I'm trying to conditionally extract the value of an element from the following sample json response:
{
"books": [
{
"title": "book 1 title",
"author": {
"firstName": "author01",
"lastName": "abc"
}
}
{
"title": "book 2 title",
"author": {
"firstName": "author02",
"lastName": "xyz"
}
}
]
}
I want to select the book title where lastName == xyz. Here the expression that I use: $.books[?(@.author.lastName=='xyz')]
but it returns []
Thanks
