neo4j-streams
neo4j-streams copied to clipboard
Add option to create non-existent nodes at relationship creation
Feature description
Working with the Kafka Connect sink connector in the CUD mode, when creating a relationship between nodes that don't exist (one or both of them) the relationship is not created. It would be good if there was an option that would instruct the connector to create the missing node(s) with the information provided in the message ie. data in the from
and to
fields where ids
and labels
are specified.
Currently we have:
{
"op":"merge",
"properties":{"propkey":"propval"},
"rel_type":"a-likes-target-node",
"labels":["a-likes-target-node"],
"from":{"ids":{"node-a":"node-a-id"},"labels":["geo"]},
"to":{"ids":{"classicifation":"classicifation-1"},"labels":["soil"]},
"type":"relationship"
}
From a slack conversation with one of the guys working on the connector we could have:
{
"op":"merge",
"properties":{"propkey":"propval"},
"rel_type":"a-likes-target-node",
"labels":["a-likes-target-node"],
"from":{"ids":{"node-a":"node-a-id"},"labels":["geo"], "op": "merge"},
"to":{"ids":{"classicifation":"classicifation-1"},"labels":["soil"], "op": "merge"},
"type":"relationship"
}
@marek-babic I'm the guy who you chatted with, thanks for opening this we'll keep you posted
Hey @conker84, brilliant, thanks.
Hi, Missing
override val properties: Map<String, Any?> = emptyMap(),
For CUDNodeRel. So, properties are just avoid at node merge if using it with relationship.