Cypher RETURN Clause: Selecting & Shaping Query Results [Byte-Sized Cypher Series]
It’s Monday, so that means it’s time to learn some Cypher!
Byte-Sized Cypher is a beginner-friendly video series that 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 gdotv, 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 covered the Cypher CREATE clause for adding data to your graph, took a closer look at using labels in Cypher, and learned how to use the MATCH clause to find specific nodes and relationships. This week, we’ll dive into the RETURN clause and how it helps you manage exactly what your query gives you.
The Cypher RETURN Clause: Selecting & Shaping Graph Query Results
In this week’s episode, Jason unwraps the Cypher RETURN clause and how you can use RETURN to precisely control what data your Cypher queries give back.
Whether you’re brand new to graph technology or tightening up your Cypher queries, this video shows how RETURN helps you keep results lightweight, focused, and intentional. Think of it as choosing the exact candy you want, not the whole bag. 🍭
What you’ll learn in this episode:
- What the RETURN clause does
- Use the RETURN clause in Cypher to select nodes, relationships, and properties
- Return full entities vs. specific properties for cleaner query results
- Rename columns with AS for more readable and shareable outputs
- Combine nodes, relationships, and properties in a single RETURN
- Introduction to aggregation functions like count()
- Grouping query results
- Eliminate duplicates with DISTINCT
Special note: In this video, Jason makes great use of the gdotv 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, gdotv helps you do your best work with graph technology – but don’t just take our word for it. Try it out for yourself!
Looking to Dive Deeper into Cypher?
For a full technical specification of the Cypher query language, here’s the most current openCypher spec (version 9). Or for a hands-on introduction with full documentation, check out the Cypher documentation written by the Neo4j team.
Also for handy reference, here are just a few of the most popular graph databases and graph query engines that use Cypher or an openCypher variant:
- Neo4j (including AuraDB)
- Memgraph
- FalkorDB
- Amazon Neptune & Neptune Analytics
- ArcadeDB
- Kuzu
- LadybugDB
- RyuGraph
- PuppyGraph
- And others
Psst! All of the above graph tech tools are compatible with gdotv 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 gdotv blog every Monday. See you then!
Ready to do more with graph tech? Try out gdotv today and level up your graph game with an IDE designed to help you do your best work with graph databases.
