Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-04-2022 01:27 AM
So I am having a CSV which has data like the below
Thanks in advance.
05-04-2022 01:42 PM
You can use FOREACH
FOREACH(ignoreMe IN CASE WHEN row.Options is not null and row.Condition is not null THEN [1] ELSE [] END|
MERGE (a:Question {question: row.Question})
MERGE (b:Condition {condition: row.Condition})
MERGE (a)-[:MELLO_3]->(b)
)
05-04-2022 10:43 PM
Hey thanks for the response. I did like this
MERGE (a:Question {question: row.Question})
FOREACH(ignoreMe IN CASE WHEN row.Options is not null and row.Condition is not null THEN [1] ELSE [] END|
MERGE (b:Condition {condition: row.Condition})
MERGE (a)-[:MELLO_3]->(b)
Because the solution you gave didn't create the node "Hello_4"
05-05-2022 03:57 AM
Hie,
So is there a way to call apoc inside the foreach condition, something like
FOREACH(ignoreMe IN CASE WHEN row.Option is not null and row.Condition is not null THEN [1] ELSE [] END|
MERGE (b:Condition {condition: row.Condition})
with a,b,line
CALL apoc.create.relationship(a, 'investigate',{relation:line.Option}, b) YIELD rel
REMOVE rel.noOp
)
All the sessions of the conference are now available online