Madmartigan
Madmartigan

Reputation: 453

Return nodes related with itself in Neo4j

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

Answers (1)

logisima
logisima

Reputation: 7478

You should use this instead : MATCH (n)-->(n) RETURN n Without the relationship direction, you will have the result twice.

Upvotes: 2

Related Questions