Reputation: 453
How can I get the nodes that are related with any relationship with itself in Neo4j?
It shoud be something like this?:
MATCH (n)-[]-(n)
RETURN n
Thanks in advance.
Upvotes: 0
Views: 41
Reputation: 7478
You should use this instead : MATCH (n)-->(n) RETURN n
Without the relationship direction, you will have the result twice.
Upvotes: 2