Skip to content

Query Filtering Based Values Returning Bizarre Results #332

Discussion options

You must be logged in to vote

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

$.shelves[*].books[?(@.title == 'House of Trees')]

T…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@RobertLbebber
Comment options

@RobertLbebber
Comment options

Answer selected by RobertLbebber
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants