Essentially, I have a set of transactions with senders and receivers:
Transaction 1 - Sender Joe - Receiver Bob
Transaction 2 - Sender Bob - Receiver Sam
Transaction 3 - Sender Bob - Receiver Nick
My goal is to take each unique sender and receiver and create a unique Person Node, with additional properties, like last_online
and email
, and eventually, the relationship chain (Person) -> sends -> (Transaction) -> to -> (Person)
. I have a small subset of these users already defined, and I want to combine the unknown and known users into the same set.
I've tried using merge
and create_unique
, and I end up creating duplicate nodes for every single Person-Transaction relationship, which I now understand why (As explained here). However, I still can't figure out how to accomplish what I'm trying to accomplish.
Edit: Here are the queries that I am running:
MATCH (t:Transaction) MERGE (p:Person{name:t.sender}) - [:sends] -> (t)
MATCH (t:Transaction) MERGE (t) - [:to] -> (p:Person{name:t.sender})
Each of these queries creates n
wallets for each of the n
transactions.
MERGE
query ? I think you have done a mistake in it – logisima