THEN ELSE condition statements in cypher query language in neo4j
<p>I want to execute an CREATE statement in THEN and UPDATE in ELSE statement  in cypher query language in Neo4j.</p>

<p>Here is my query:</p>

<pre><code>MATCH (product:user_product) WHERE id(product) = 45
OPTIONAL MATCH (user:person) where id(user) = 90 
FOREACH (o IN CASE WHEN user IS NOT NULL THEN 
CREATE (user)&lt;-[:HAS_USER]-(product)
ELSE 
set product.userStatus = 1
END)
return user, product
</code></pre>