Hello,
I want to MERGE
a node:
MERGE (a: Article {URL: event.URL})
If the node does not exist, I need to do this:
ON CREATE FOREACH( site_name in CASE WHEN event.site_name is not null then [1] ELSE [] END |
MERGE (w: Website { value: event.site_name})
MERGE (w)-[:PUBLISHED]->(a))
// all of the tag creation
FOREACH( tag in CASE WHEN event.tags is not NULL then event.tags else [] END |
Merge (t: Article_Tag {value: tag})
CREATE (a)-[: HAS_ARICLE_TAG {date:event_datetime}]->(t))
I believe that ON CREATE
only works with SET
, but as above, i need to execute multiple statements.
I have tried ON CREATE FOREACH(ignoreme in case when event.article is not null then [1] else [] end |...\\ multiple statements)
but this does not escape the SET problem.
Is there a way to create multiple nodes and relationships with an ON CREATE
clause?