-1

I am querying a database and I want to display only a certain relationship but I get from neo4j all the relationships. enter image description here

This is my code:

MATCH (p1:Person {name:'John Snow'})-[r:LOVES]-> (p2:Person {name:'Daenerys Targaryen'})
 return p1,p2,r

I want to show only: (Jon Snow) -[Loves]-> (Deanerys Targaryen)

How can I fix this?

genericname
  • 167
  • 3
  • 11
  • 1
    Possible duplicate of [Cypher query gives unnecessary relationships](https://stackoverflow.com/questions/45759688/cypher-query-gives-unnecessary-relationships) – InverseFalcon Aug 12 '18 at 09:41
  • 1
    Possible duplicate of [How to hide unwanted relationships between nodes in Neo4j](https://stackoverflow.com/questions/37603618/how-to-hide-unwanted-relationships-between-nodes-in-neo4j) – jonrsharpe Aug 12 '18 at 09:41

2 Answers2

1

Your query return as you expected.

Open the Table/Text tab, you will see that only matching relationship is returned.

I guess the GUI client just try to smart to visualize all relationships for you.

Mạnh Quyết Nguyễn
  • 17,677
  • 1
  • 23
  • 51
0

Turn off autocomplete option on you Neo4j Browser.

See screenshot