Combine filters using Logical AND and OR
masterJSONPath supports logical operators to combine multiple relational expressions within a filter:
- Logical AND (
&&): Both conditions must be true. - Logical OR (
||): At least one condition must be true.
Example of Logical AND:
json.Get("warehouse:1", "$.inventory[?(@.gender==\"Men\"&&@.price>20)]");Example of Logical OR:
json.Get("warehouse:1", "$.inventory[?(@.price<100||@.gender==\"Women\")].id");