I'm trying to load a set where row.type are the label of the node and it's dynamic in the set .
When I run the first part of the load I get the correct amount, but when I run the last part I get 2x nodes. 50% where the label is correct and 50% where the label is null
LOAD CSV WITH HEADERS FROM 'file:///nodes.csv' AS row
MERGE (node {id: row.id})
SET node += {
name: row.name,
behaviorsetdefinition: row.behaviorsetdefinition,
acceptance: row.acceptance
}
WITH node, row.type AS label
CALL apoc.merge.node.eager([label], {id: node.id}) YIELD node AS labeledNode
SET labeledNode = node
RETURN labeledNode