Checking for multiple existence conditions

39 views
Skip to first unread message

Adam Bolding-Jones

unread,
Nov 4, 2016, 11:19:51 PM11/4/16
to JsonPath

Given the JSON below:


{
    "store": {
        "book": [
            {
                "author": "Nigel Rees",
                "title": "Sayings of the Century"
            },
            {
                "category": "fiction",
                "title": "Sword of Honour",
                "price": 12.99
            } 
        ]
}


How can I construct a JSON path to retrieve the book elements that have categoryprice, and title elements? I've tried $.store.book[?(@.price && @.category && @.title)] but that doesn't work (it seems that kind of predicate doesn't allow for multiple conditions?)

Reply all
Reply to author
Forward
0 new messages