Cypher MATCH Clause: Finding Nodes & Relationships in Your Graph [Byte-Sized Cypher Series]
It’s time for another installment of Byte-Sized Cypher! This beginner-friendly video series teaches you the Cypher query language through short, practical examples and memorable snack-based metaphors. 🍡
In this series, DevRel legend and snack enthusiast Jason Koo breaks down the most important openCypher clauses into small, digestible episodes. openCypher is the open source version of the Cypher query language originally created by Neo4j, and is designed specifically for working with graph databases and highly connected data.
Just to clarify: Jason doesn’t work for G.V(), but we’re big fans of this video series, and with his permission, we’re sharing these videos with our blog readers. We hope this series helps you master the Cypher query language – or even just get comfortable with using it for the very first time!
In previous weeks, we introduced the series, covered the Cypher CREATE clause for adding nodes and relationships to your graph, and took a closer look at using labels in Cypher (including when to use labels vs. properties). This week, we’ll walk you through the Cypher MATCH clause to help you find particular nodes and relationships in your graph data.
The Cypher MATCH Clause: Finding Nodes & Relationships in Your Graph
In this week’s episode, you learn all about Cypher’s MATCH clause for querying graph databases. MATCH describes the shape of data you’re looking for in a graph database. Combined with variables and the RETURN clause, it forms the foundation of Cypher querying.
This beginner-friendly Cypher tutorial covers how to find nodes, relationships, and paths in your graph data using a snack-purchasing dataset to demonstrate practical examples – including how to get your hands on a limited-edition Pocky snack. (Just kidding, Jason leaves us in the dark on that front!)
What you’ll learn:
- MATCH fundamentals – the core of Cypher queries
- The MATCH-variables-RETURN trio in many Cypher queries
- Variables: naming and referencing nodes and relationships
- Semicolons vs. Commas in Cypher
- Filtering with labels and properties
- Creating relationships with MATCH + CREATE
- Path variables for complex queries
- Wildcards and relationship patterns
- Cypher query optimization with hop limits
Special note: In this video, Jason makes great use of the G.V() graph database IDE to help demonstrate Cypher queries and visualize the resulting graph data. No matter if you’re new to graphs or a seasoned vet, G.V() helps you do your best work with graph technology – but don’t just take our word for it. Try it out for yourself!
Does My Graph Database Use Cypher?
Not all graph technology uses the Cypher query language. Some use Gremlin, GQL, SPARQL, SQL/PGQ (part of SQL:2023), or other query languages instead.
Here’s an incomplete list of the most common graph databases that use Cypher or an openCypher variant:
- Neo4j (including Aura)
- Memgraph
- FalkorDB
- Amazon Neptune & Neptune Analytics
- ArcadeDB
- Kuzu
- LadybugDB
- RyuGraph
- PuppyGraph
- And others
All of the above graph databases and graph query engines are compatible with G.V() to use for Cypher query writing, editing, profiling, and more.
See You at the Next Episode of Byte-Sized Cypher!
Hungry for more Cypher? Check out the full series playlist here as Jason is always adding more videos. If you enjoyed this video, subscribe to Jason Koo’s YouTube channel for more videos on graph technology and other great developer tools, platforms, and languages.
Need a break between snacks? Catch the next episode of Byte-Sized Cypher here on the G.V() blog every Monday. See you then!
Looking for a tool to help you learn and explore a new graph database? Download G.V() today and amp up your graph skills with an IDE built by devs for devs.
