I think contrary to the intention of MERGE . You would use it to describe how you want the chart to look after fulfilling your request, and not to find out what it looks like before the read and write operations should be strictly separated from each other in Cypher. However, you can set a property of a dummy type, for example, @LameCoder:
MERGE (u:User {id_str:"123"}) ON CREATE SET u.onCreate = true WITH u, has(u.onCreate) as onCreate REMOVE n.onCreate RETURN u, u.onCreate
will return (u), true if it is created, (u), false if not, and do not leave side effects. Or you can save timestamps, perhaps one for creating a node, and another for the last change to node - I think the example is from the documentation. it
MERGE (u:User {id_str:"123"}) ON CREATE SET u.created = timestamp() ON MATCH SET u.lastModified = timestamp() RETURN u, has(u.lastModified) as onMerge
will be similar to the request above.
source share