h2non / jsonpath-ng

Finally, a JSONPath implementation for Python that aims to be standard compliant. That's all. Enjoy!
Apache License 2.0
582 stars 85 forks source link

Add OR and AND operators #37

Open iserranos opened 4 years ago

iserranos commented 4 years ago

There are already arithmetic operators (+-*/) in the extended version, so I think the next logical step would be to add the OR (|) and AND (&) operators.

For example:

{"a": "a"}
{"b": "b"}
"$.c | $.b" will return "b"
"$.a & $.b" will return "ab"

I hope that these examples have been understood to work. I think it is a basic functionality for the extended version that could enhance its use much more.

michaelmior commented 1 month ago

@iserranos I don't understand what you're proposing. Your first sentence seemed like you wanted logical AND/OR, but your second example shows string concatenation. Could you clarify?