openCypher icon indicating copy to clipboard operation
openCypher copied to clipboard

Support for DECODE or MAP function as an alternative to simple CASE

Open ADTC opened this issue 9 years ago • 0 comments

Can Neo4j Cypher support DECODE function in a future version? It could simply be an alias to the simple CASE:

CASE test
WHEN value THEN result
[WHEN ...]
[ELSE default]
END

translates as DECODE to:

DECODE ( test
, value , result
[, value , result
, ...]
[, default] )

The function is less verbose than simple CASE.

If the word DECODE is not the right fit, consider the word CASE itself, or something else like MAP (for mapping values to alternative values).

Moved from neo4j/neo4j#7139.

ADTC avatar May 17 '16 13:05 ADTC