dchester / jsonpath

Query and manipulate JavaScript objects with JSONPath expressions. Robust JSONPath engine for Node.js.
MIT License
1.34k stars 216 forks source link

Is it possible to filter out the specified object from the nested object (map structure)? #145

Open roychen11232357 opened 4 years ago

roychen11232357 commented 4 years ago

Suppose my input is like this

{
    "values": {
        "obj1": {
            "key1": 46,
            "key2": 19
        },
        "obj2": {
            "key1": 10,
            "key2": 20
        }
    },
    "option": "test"
}

And I want to filter out the results that meet values.obj1.key1>20, the expected output is like this

{
    "values": {
        "obj1": {
            "key1": 46
        }
    },
    "option": "test"
}

Is it possible to achieve through jsonpath?