apoc.whenProcedureDeprecated in Cypher 25
|
This procedure is deprecated. Use Cypher’s conditional queries instead. |
|
This procedure is not considered safe to run from multiple threads. It is therefore not supported by the parallel runtime. For more information, see the Cypher Manual → Parallel runtime. |
Syntax |
|
||
Description |
This procedure will run the read-only |
||
Input arguments |
Name |
Type |
Description |
|
|
The predicate deciding if to run the `ifQuery`or not. |
|
|
|
The Cypher statement to run if the condition is true. |
|
|
|
The Cypher statement to run if the condition is false. The default is: ``. |
|
|
|
The parameters for the given Cypher statement. The default is: |
|
Return arguments |
Name |
Type |
Description |
|
|
The result returned from the evaluated Cypher query. |
|
Usage examples
CALL apoc.when(false, 'RETURN 7 as b');
WHEN false THEN RETURN {b: 7} AS value
ELSE RETURN {} AS value
| value |
|---|
{} |
CALL apoc.when(true, 'RETURN $a + 7 as b', 'RETURN $a as b',{a:3})
WITH 3 AS a
CALL (a) {
WHEN true THEN RETURN a + 7 AS b
ELSE RETURN a AS b
}
RETURN { b: b} AS value
| value |
|---|
{b: 10} |