i have a node.js app where i have to create a unique user based on the username property of a node such as
(:USER {name:'username',password:'pass123'})
so i want to run a query that checks if a user with the given username exists or not and if not then create the node and set its password.
I am thinking about which way to go.. either create a CONSTRAINT or use CREATE UNIQUE ON MATCH ON CREATE or first run a MATCH query and if it returns data then run CREATE query based on the result
i am using the neo4j-driver for node and the query run returns the result Obj