Building Conditions
Conditions are JSON like objects which process and return a boolean output at the runtime. An expressions object looks like -
Syntax
The condition can be build in 2 types -
Simple Condition
This condition has at most one condition comparison key.
Properties
Field | Description | Required |
---|---|---|
<key> | The key which needs to be compared with the value. This can also be a Magical Autocomplete. | true |
<operator> | A CQL conditional operator which defines what type of comparison has to be done in this condition object. You can check the list of CQL conditions operators here. | true |
<value> | The value to compare the |
Compound Condition
This condition can compound together multiple Simple and Compound Conditions together.
Properties
Field | Description | Required |
---|---|---|
<compound_operator> | A CQL compound operator which defines what type of comparison has to be done between the list of nested conditions. You can check the list of CQL compound operators here. | true |
<cond> | A nested Simple Condition object or Compound Condition object. | true |
Examples
Simple Conditions
The above expression will return true if the variable name
contains the value Shrey else will return false.
Compound Conditions
The below snippet shows how you can build the query -
Multiple Level of Conditions
The below snippet shows how you can build the query -
List of Compound Operators available in CQL -
List of Conditional Operators available in CQL -
Last updated