Neo4j create if not exist otherwise update

neo4j

Solution

MERGE (u1:User)-[r:REL]->(u2:User)
ON CREATE SET
    u1.prop1 = val1,
    u2.prop2 = val2,
    r.prop3 = val3
ON MATCH SET
    u1.prop1 = newVal1,
    u2.prop2 = newVal2,
    r.prop3 = newVal3

Have a look at the Neo4j docs for "MERGE".

Problem

I need to create a relation between two users once, and update its properties since then. Is there a way to do something like "create if not exist otherwise update" in Neo4j using Cypher?

Original source