liveBook · Manning

Return statement

As explained in Graph Algorithms for Data Science

The RETURN clause is a Cypher clause that specifies variables or expressions to retrieve as query results.

RETURN is a Cypher clause that specifies the variables or expressions retrieved as query results. It can appear once, as the final clause, except in unions and subqueries. section 3.1.1

Use RETURN to:

  • Fetch a created node by returning its variable. section 3.1.1
  • Return all variables with RETURN * when inspecting created nodes and relationships. section 3.1.1
  • View returned graph elements in Neo4j Browser. section 3.1.1

Create and retrieve a node

CREATE (p:Person{name:'Frodo'}) RETURN p

How Graph Algorithms for Data Science covers it

How deep it goes
Defines returned variables and clause placement, while deferring unions and subqueries to later treatment.
Examples
Demonstrates returning one created node and returning all variables from created nodes and relationships.
What it assumes
Assumes familiarity with basic Cypher creation syntax, node variables, labels, and properties.
What you can do after
Apply it in Cypher to retrieve created graph elements and inspect their visualization in Neo4j Browser.
How it connects
Connects Cypher results with variables, CREATE clauses, graph patterns, unions, subqueries, and Neo4j Browser.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.