You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[case()](<#case()>)| Evaluates a list of predicates and returns the first result expression whose predicate is satisfied. |
14
-
|[iff()](<#iff()>)| Evaluates the first argument (the predicate), and returns the value of either the second or third arguments |
13
+
|[case()](#case)| Evaluates a list of conditions and returns the first result expression whose condition is satisfied. |
14
+
|[iff()](#iff)| Evaluates the first argument (the predicate), and returns the value of either the second or third arguments |
15
15
16
16
## case()
17
17
18
-
Evaluates a list of predicates and returns the first result expression whose predicate is satisfied.
18
+
Evaluates a list of conditions and returns the first result whose condition is satisfied.
19
19
20
20
### Arguments
21
21
22
-
-predicate: An expression that evaluates to a `boolean` value.
23
-
-then: An expression that gets evaluated and its value is returned from the function if `predicate`is the first predicate that evaluates to `true.`
24
-
-else: An expression that gets evaluated and its value is returned from the function if neither of the `predicate` evaluate to `true.`
22
+
-condition: An expression that evaluates to a Boolean.
23
+
-result: An expression that Axiom evaluates and returns the value if its condition is the first that evaluates to true.
24
+
-nothingMatchedResult: An expression that Axiom evaluates and returns the value if none of the conditional expressions evaluates to true.
25
25
26
26
### Returns
27
27
28
-
The value of the first `then` whose `predicate` evaluates to true, or the value of else if neither of the predicates are satisfied.
28
+
Axiom returns the value of the first result whose condition evaluates to true. If none of the conditions is satisfied, Axiom returns the value of `nothingMatchedResult`.
[Run in Playground](https://play.axiom.co/axiom-play-qf1k/explorer?initForm=%7B%22apl%22%3A%22%5B%27sample-http-logs%27%5D%5Cn%7C%20extend%20Category%20%3D%20case%28%5Cn%20%20%20%20req_duration_ms%20%3C%2018%2C%5Cn%20%20%20%20resp_body_size_bytes%20%3E%3D%2018%2C%20%5Cn%20%20%20%20resp_header_size_bytes%20%3E%2035%5Cn%29%22%2C%22queryOptions%22%3A%7B%22quickRange%22%3A%2230d%22%7D%7D)
51
+
[Run in Playground](https://play.axiom.co/axiom-play-qf1k/explorer?initForm=%7B%22apl%22%3A%22%5B'sample-http-logs'%5D%5Cn%7C%20extend%20status_code%20%3D%20case(status_int%20%3D%3D%20200%2C%20'OK'%2C%20status_int%20%3D%3D%20201%2C%20'Created'%2C%20status_int%20%3D%3D%20301%2C%20'Moved%20Permanently'%2C%20status_int%20%3D%3D%20500%2C%20'Internal%20Server%20Error'%2C%20'Other')%22%2C%22queryOptions%22%3A%7B%22quickRange%22%3A%2230m%22%7D%7D)
0 commit comments