Closed LQBing closed 1 year ago
Hi, I just happened to see this PR and come up with a question.
How is delete()
different from filter()
given the filter function is lambda d: True
?
>>> jsonpath_expr = parse("foo[*].baz")
>>> jsonpath_expr.filter(lambda d: True, {'foo': [{'baz': 1}, {'baz': 2}]})
{'foo': [{}, {}]}
Verified
Hi, I just happened to see this PR and come up with a question.
How is
delete()
different fromfilter()
given the filter function islambda d: True
?>>> jsonpath_expr = parse("foo[*].baz") >>> jsonpath_expr.filter(lambda d: True, {'foo': [{'baz': 1}, {'baz': 2}]}) {'foo': [{}, {}]}
I verified, no different between their result. But it is not easy to find this usage in the readme.md, and the delete or remove function is a common methods. Can you add the usage into the readme.md?
Can you add the usage into the readme.md?
Sorry but no, I'm not even the owner or a contributor of this repo, just someone trying to figure out how to do filtering with jsonpath.
But I think #44 may be useful to you.
I added some relevant examples to the README, so I think this can be closed. Feel free to comment if you're still having any issues.
Coverage remained the same at 0.0% when pulling e79fc1033bfcd13103d0f66105b7f192e91f038b on LQBing:master into e5405c1adc9b90aa081595d4982833f6f2a2893a on h2non:master.