Its a MERGE question - sorry if its been asked before....
I'm looking for UPSERT functionality - I know the graph pattern I want to create but I don't know how much of the pattern already exists...
How do I match & return the part of the pattern that exists & then use that to build up the rest?
e.g. MERGE(server:Windows VMWare Server
{name:'Server1',type:'Windows VMWare Server',scope:'UK'})-[:PARENT_OF]->(:Logical Server
{name:'Operating System',type:'Logical Server',scope:'UK'})-[:PARENT_OF]->(:PagingFile
{name:'pagefile.sys'})
BUT Server1 & Operating System already exist - I just need to add the pagefile.sys node to the existing nodes.
I guess I need to MATCH the pattern, work out what nodes already exist & pass down to a MERGE to add the missing nodes/relationships.
I hope this makes sense!
Mike