Query Filtering Based Values Returning Bizarre Results #332
-
I am trying to use
For instance, I want a query to return that returns the book with the title 'House of Trees'. I have also tried to get the inner array and then do a filter on that inner array separately, to no success. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There are a few issues with the JSON you posted, I believe you meant to post {
"shelves": [
{
"books": [
{
"price": 10,
"title": "Fire on the Water"
}
]
},
{
"books": [
{
"price": 5,
"title": "House of Trees"
}
]
},
{
"books": [
{
"price": 15,
"title": "More Things"
}
]
}
]
} Then the query should be
That should give you [{"price":5,"title":"House of Trees"}] Note that you need the wildcard selector after 'shelves', otherwise You could also use the query
|
Beta Was this translation helpful? Give feedback.
-
You could also use a jsoncons JSONPath extension, the parent operator
This returns the grandparent of the selected node: [{"books":[{"price":5,"title":"House of Trees"}],"uid":2}] |
Beta Was this translation helpful? Give feedback.
There are a few issues with the JSON you posted, I believe you meant to post
Then the query should be
T…