How can I accomplish the following.
was looking at using
CREATE (ah:AccountHolder {
accountEntityId: "CABLZAJJ-1366999182",
accountId: "1366999182",
tenantId: "CABLZAJJ",
accountAgentId: "CABLZAJJ",
bicfi: "CABLZAJJ",
fullName: "TINY"
}) ON DUPLICATE KEY IGNORE;
and created a unique constraint on AccountHolder: accountEntityId
but it seems this on DUPLICATE is incorrect/wrong, so thinking how better to do...
So was thinking of using a Merge statement.
If the node does not exist, create it.
if it exists with say 4 fields, and I got 6, 3 new, 3 old, update the current 3 and add the new 3 fields.
aka Merging old and new... worried, without loosing old.
where the same field name is specified, the old value is updated with new value.
MERGE (ah:AccountHolder {accountEntityId: event.accountEntityId})
SET ah.accountId=event.accountId,
ah.tenantId=event.tenantId,
ah.accountAgentId=event.accountAgentId,
ah.optional=event.optional;
worried here... ah.optional will be reset to whatever event.optional is, wiping out the old contents, issue is optional is a dynamic list...
I need to some how have some elasticity in which fields are being ingested (this will form part of a Kafka Connect sink job.)
G