Reputation: 3261
I want to add multiple value for a single relationship properties.
just like below..
I have a relation is "CALLED" which is bidirectional.I want to have two value for "DURATION" like DURATION (100-200->500,200-100->600)
Can I put two values for a single proeprties??
Upvotes: 3
Views: 509
Reputation: 39905
You can use a property having an array of Strings as value:
MERGE (a:Person{number:'123'})
MERGE (b:Person{number:'456'})
MERGE (a)-[r:CALLED]->(b)
ON CREATE SET r.duration = ["100-200->500"]
ON MATCH SET r.duration = ["100-200->500"]
Later on when adding the second duration value, use
MERGE (a:Person{number:'123'})
MERGE (b:Person{number:'456'})
MERGE (a)-[r:CALLED]->(b)
ON MATCH SET r.duration = n.duration + "200-100->600"
N.B. the "+" operator on an array amends a new element to the array.
Upvotes: 5