If I have the cypher query
MATCH (a)-[r]->(b)
I can get the labels of a and b fine line so
MATCH (a)-[r]->(b)
RETURN labels(a), labels(b)
But when I want the label of r
using the same syntax
MATCH (a)-[r]->(b)
RETURN labels(r)
I get
Type mismatch: expected Node but was Relationship
How do I return the label of r
, the relationship?
In Neo4j, relationships don't have labels - they have a single type, so it would be:
MATCH (a)-[r]->(b)
RETURN TYPE(r)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments