0
votes

How can I display neo4j nodes and a unique relationship type linking them?

I have a Neo4j graph, the nodes are linked with multiple relationship types (DODAG, BE, etc..) and I want to display the nodes linked with a specific relationship type without displaying the other relationship links.

When I run

MATCH p=()-[r:DODAG]->() RETURN p

I get the nodes linked by the DODAG relationship type, but the graph also displays the other relationships that link these nodes (BE, etc..)

How could I return the same result, but without the other relationships?

Thank you!

1
You can check off Connect result nodes in the Browser Settings of the console and re-run your query.Dave Bennett
Thank you for the answer!Chanta

1 Answers

0
votes

Instead of returning path, return those specific nodes and relationship only:

MATCH (a)-[rel:DODAG]->(b)
RETURN a, rel, b