kg1991
kg1991

Reputation: 3

How to return a list of people in neo4j?

I am new to neo4j and i am trying to answer a few practice questions. However, i am not getting the syntax and struggling to understand how to return a list of people. The following is the question i am trying to answer:

Assume we have a graph database containing two sets of nodes labelled :Reader and :Book. These nodes are connected with relationships labelled :READ.

Write the Cipher code to list all readers who have read the book with the title "Moby Dick"

Upvotes: 0

Views: 376

Answers (1)

CleanBold
CleanBold

Reputation: 1592

This query will get you those readers.

MATCH(r:READER)-[:READS]->(b:BOOK{title:"Moby Dick"}
RETURN r

Upvotes: 1

Related Questions