Taja Jan
Taja Jan

Reputation: 1411

How can I find nodes with specific relationships?

How can I find nodes with specific properties using a Cypher query language? I have a list of cities. List contains city names and countries where those cities are situated. I need to print out the country for one specific city.

Upvotes: 0

Views: 38

Answers (1)

Taja Jan
Taja Jan

Reputation: 1411

The code for this is:

MATCH (city:City)-[:IN]-(country:Country)
WHERE city.name = "London"
RETURN country.name;

The MATCH clause specifies a node and relationship pattern with two connected nodes, labeled City and Country, connected by a relationship of type IN.

Upvotes: 0

Related Questions