cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How do I set a property to one of two values?

ldj20
Node Link

I want to set a property to either a variable or -1 if the variable is exactly equal to 0. How would I do this?

1 REPLY 1

You can use a CASE statement to conditionally determine the value to save. 

https://neo4j.com/docs/cypher-manual/current/syntax/expressions/#query-syntax-case