Hi!
I'm trying to use CALL apoc.do.when() but I can't figure out how to use YIELD properly.
Here is my query:
LOAD CSV WITH HEADERS FROM "file:///example_drugs.csv" as drugs
MERGE (d:Drug {drugbankId: drugs.drugbankId})
SET d.name= drugs.name
SET d.description= drugs.description
SET d.casNumber= drugs.casNumber
SET d.unii= drugs.unii
SET d.state= drugs.state
WITH drugs.productName as productName, d
CALL apoc.do.when(productName IS NOT NULL,
"MERGE (p:Product{name: productName}) MERGE (d)-[r:HAS_PRODUCT]-(p)", YIELD ???)
return p
I tried to put YIELD in various places, but every time I get a error. Could someone help me with writing this query properly?