How to write a query when a node has two same directions

8 views
Skip to first unread message

ravika...@gmail.com

unread,
Dec 20, 2016, 5:38:50 PM12/20/16
to Neo4j
Hi All,

I am new to Neo4J and learning to write queries. I had a scenario mentioned as in attached,

I want to write a query to link all 4 labels so as to access their properties. I am confused on how to write relation from B to A and C to A. Thanks in Advance.

Ravi
Capture.PNG

Michael Hunger

unread,
Dec 20, 2016, 7:18:00 PM12/20/16
to ne...@googlegroups.com
Hi Ravi,

MATCH (a:Person {name:"A"})
MATCH (a)-[:HAS_WIFE]->(d)
MATCH (a)-[:LIVES_IN]->(c)
MATCH (a)-[:HAS]->(b)

RETURN a,b,c,d

you can also join neo4j.com/slack and ask there.

Michael

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages