Hi !
I'm trying to combine the use of 2 apoc functions and I'm stuck with the use of simple/double quotes.
Here is my query :
CALL apoc.periodic.iterate('UNWIND $parameters as row
WITH row WHERE row.RAF_ID =~ "[0-9]+" RETURN row',
'CALL apoc.do.case([$row.Legal_Entity_Type CONTAINS "Special", "MATCH (s:Structure {name: "SPV"}), (cl:Customer {raf_id: $row.RAF_ID})
MERGE (cl)-[:HAS_TYPE]->(s)",
$row.Legal_Entity_Type CONTAINS "Trust", "MATCH (s:Structure {name: "Trust or foundation"}), (cl:Customer {raf_id: $row.RAF_ID})
MERGE (cl)-[:HAS_TYPE]->(s)",
$row.Legal_Entity_Type CONTAINS "Family", "MATCH (s:Structure {name: "Family office"}), (cl:Customer {raf_id: $row.RAF_ID})
MERGE (cl)-[:HAS_TYPE]->(s)",
$row.Legal_Entity_Type CONTAINS "charity", "MATCH (s:Structure {name: "Charity"}), (cl:Customer {raf_id: $row.RAF_ID})
MERGE (cl)-[:HAS_TYPE]->(s)",
$row.Legal_Entity_Type CONTAINS "EIG", "MATCH (s:Structure {name: "EIG"}), (cl:Customer {raf_id: $row.RAF_ID})
MERGE (cl)-[:HAS_TYPE]->(s)"
], "", {row:row}) YIELD value',
{batchSize:2000, params: {parameters:$parameters}})
Is it possible to use the condition in apoc.do.case with this kind of query to find out if a string contains a word and if yes, matching the proper node and create the relationship ?
Or am I going to use multiple apoc.periodic.iterate for each kind of word I want to match ?
Thanks