Currently i am working with graph db. I have two nodes and i need to create more than one label to the same relation. Is it possible to create more than one label to a relationship in cypher query? I tried this, but not working:
START n=node(1), n1=node(2) CREATE UNIQUE (n)-[r:HAS_TEST:HAS_ATTENDED]->(n1) return n,n1;
If it is possible, how? If it is not possible why?
A relationship has a single type, so you cannot do what you've asked. Instead, create two relationships:
START n=node(1), n1=node(2)
CREATE UNIQUE (n)-[:HAS_TEST]->(n1)
CREATE UNIQUE (n)-[:HAS_ATTENDED]->(n1)
RETURN n,n1;
Or create a new relationship type that implies both HAS_TEST and HAS_ATTENDED.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With