Say I have an expression:
( A >= 10 && B == 20 ) || ( C < 30 ) || ( D != 50 )
I can suggest the following JSON to store/represent this expression:
{ "filter":
[
{ "var":"A", "condition":"ge", "num":10 },
{ "var":"B", "condition":"e", "num":20 }
],
[
{ "var":"C", "condition":"lt", "num":30 }
],
[
{ "var":"D", "condition":"ne", "num":50 }
]
}
in which "filter" maps to an array of sub-arrays. All elements in each sub-array are associated with AND, while all sub-arrays are associated with OR.
Is there anything I've overlooked in writing the JSON like this?
A < B
? or even10 < A
? What is the order? – Korten