Not sure if this is the correct location for this question, but I am trying to use apoc.do.when with my neo4j version 5 instance. I have been trying to use the docs to create my query but for some reason one of my parameters is not being changed correctly in my query string and I am not sure why.
LOAD CSV WITH HEADERS FROM 'file:///pcs.csv' AS row
with row, row.left as left, row.left_type as left_type
CALL apoc.do.when(
row.concept IS NOT NULL,
'CREATE (n:left_type {id: left }) RETURN n AS node',
'CREATE (c:Node{name:"C"}) RETURN c AS node',
{left_type:left_type,left:left})
YIELD value
RETURN value.node AS node;
When I read in the rows of the csv some rows have a concept value and some don't. Based on this I want to create different nodes in the database. The condition is working and the "left" parameter is being correctly changed but left_type is still called left_type not the actual label it should be.
{
"identity": 507,
"labels": [
"left_type"
],
"properties": {
"id": "1"
},
"elementId": "507"
}
Looks like this^
Any help would be useful