MATCH (n:Brand)
CASE
WHEN not exists(n.alias) THEN SET n.hasAlias=0
ELSE SET n.hasAlias=1
END AS result
return result
What I want is to create a new integer property 'hasAlias' for each node, based upon the existence of the property 'alias'. But I received this error message:
The problem is that you can't use CASE to perform conditional Cypher, the SET clause (as well as all other clauses) are not allowed. CASE is only used to change what expression gets used.