We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from jsonpath_ng.ext import parse from pprint import pprint datum = { "a": "x", "array": [ {"bcde": "y"} ] } pprint(parse('$..*').find(datum)) pprint(parse('$..*[?@ =~ "a"]').find(datum)) pprint(parse('$..*[?@ =~ "b.*"]').find(datum))
Results:
[DatumInContext(value='x', path=Fields('a'), context=DatumInContext(value={'a': 'x', 'array': [{'bcde': 'y'}]}, path=Root(), context=None)), DatumInContext(value=[{'bcde': 'y'}], path=Fields('array'), context=DatumInContext(value={'a': 'x', 'array': [{'bcde': 'y'}]}, path=Root(), context=None)), DatumInContext(value='y', path=Fields('bcde'), context=DatumInContext(value={'bcde': 'y'}, path=Index(index=0), context=DatumInContext(value=[{'bcde': 'y'}], path=Fields('array'), context=DatumInContext(value={'a': 'x', 'array': [{'bcde': 'y'}]}, path=Root(), context=None))))] [] []
Expected results would include a and array in the second query and bcde in the third.
a
array
bcde
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Results:
Expected results would include
a
andarray
in the second query andbcde
in the third.The text was updated successfully, but these errors were encountered: