Key operative words in Cypher

Like every database query language, there are a few operative words that have an important meaning in the composition of every query. It's useful for you to know these since you will be using them to compose your specific queries on your specific datasets.

Keyword

Function

Example

MATCH

This describes a pattern that the database should match. This is probably the most important piece of the query as it is a structural component that always starts your queries.

MATCH (me:Person)-[:KNOWS]->(friend)

WHERE

This filters results that are found in the match for specific criteria.

WHERE me.name = "My Name" AND me.age > 18

RETURN

This returns results. You can either return paths, nodes, relationships, or their properties—or ...

Get Learning Neo4j now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.