Open madnanshah opened 1 year ago
I think would could use something like this instead
obj = { "mainkey": { "k1": {}, "k2": {} } }
print(parse("$.mainkey").find(obj)[0].value.keys())
Does jsonpath-ng support tilde? I've only seen it used with =~
for regex filtering I believe
Duplicates https://github.com/h2non/jsonpath-ng/issues/32.
{ "mainkey": { "k1": {}, "k2": {} } }
From above, when I try to get keys with
$.mainkey.*~
I expect["k1","k2"]
but I get following errorParser failed to understand syntax '$.mainkey.~'. error message: Parse error at 1:12 near token ~ (~)
Result of
pip install --upgrade jsonpath-ng
Requirement already satisfied: jsonpath-ng in /usr/local/lib/python3.10/dist-packages (1.5.3) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from jsonpath-ng) (1.16.0) Requirement already satisfied: ply in /usr/local/lib/python3.10/dist-packages (from jsonpath-ng) (3.11) Requirement already satisfied: decorator in /usr/local/lib/python3.10/dist-packages (from jsonpath-ng) (5.1.1)