Im using this query to create some relations , but i need to create node if it doesnt exist but the merge property creates for some and for other records it gives null on id for merge.
Basically if the record exists it should merge else it should create how do i do it?
MATCH (p:person{username:'abc.com'})-[hc:HAS_RELATION]->(pp:person{username:'xyz.com'})
MERGE (con:ContactInfo{Id:hc.ContactInfoId})
ON MATCH SET con.Updated=timestamp(),hc.ContactInfoId=ID(con)
ON CREATE SET con:PersonContact,con.Created =timestamp(),con.Id=ID(con),hc.ContactInfoId=ID(con)
WITH con
Please help