Closed moshevi closed 5 years ago
Hi,
yes propositional logic is included into gval. You can use &&
and ||
. Take a look at the godoc:
https://godoc.org/github.com/PaesslerAG/gval#PropositionalLogic
@generikvault Do you familiar with that? Can you give me the expression to fulfil want I wanted on my issue? Thanks.
($.a==1) && ($.b[0].x==2 || $.b[1].y==2)
should do the job.
Hi. Is there a way to construct a single jsonpath expression that has multiple condition parts. If I have this JSON: {"a":1,"b":[{"x":2,"y":3},{"x":3,"y":2}]} And want to check that (a==1) AND (b[0].x==2 OR b[1].y==2) returns true, is there a single jsonpath expression that evaluate that (Instead of making multiple expressions and run each of them sequentially with AND/OR by code) ? Thanks.