I am trying to use the value of a node property as a variable name for a relationship property, and I haven't found any way to do it so far. Here is an example:
Let's say I have some node labels including:
(p:Person {id: #, name: "some name"})
(c:Currency {id: #, name: "currency symbol"})
(t:Transaction {id: #, amount: #}
In this case, the transaction is not linked to the currency, but ignore this for now. I want to create a relationship to show that some person transacted with another.
Assumptions:
1. c.name can be one of many currencies [USD, EUR, GBP, ... etc]
2. If person A sends multiple currencies to person B, then each currency will have its own transaction.
Now if p1 sent some amounts of USD and EUR to p2, I want to create a relationship as follows:
(p1:Person)-[TRANSACTED_WITH {USD: some amount, EUR: some amount}]->(p2:Person)
So I want the relationship to have the symbol name of a sent currency as the property name and the amount as the value of that property. There can be one or multiple currencies sent from A to B. So each relationship between two persons can have a different set of properties.
I tried the following, but it didn't work:
MERGE (p1:Person)-[TRANSACTED_WITH {c1["name"]: t1.amount}]->(p2:Person)
Is there actually any way to do that?