I am once again stuck on what I think should be a dirt-simple question that I'm unable to resolve using the Cypher manual -- how to apply a conditional value to the right-hand-side of a SET expression.
I have computed and want to retain a property value that sometimes meets some criteria and sometimes does not. I want to write a
SET expression that accomplishes this feat.
Consider a property whose name is "foobarName". Suppose I want to assign a value to "foobarName" that is "0" when some computed quantity is negative and the computed quantity otherwise.
How do I say, for example, "If value < 0, SET foobarName = '0' else SET foobarName = TOSTRING(value)"?
Once again, the manual is opaque about what is and is not allowed in various contexts. Do I write some some kind of "WHERE" clause? Do I use some "CASE" expression someplace? Is the RHS of a SET pair an expression? Do I do this in some kind of "WITH ... AS ..." statement?
It seems to me that conditionally assigning a value to a property is a common use-case. What am I missing?