99
Neo4j MATCH Clause
Neo4j MATCH clause is used to retrieve all the nodes in the Neo4j database. It shows nodes as well as relationships between them.
Show Nodes
We have already created 6 nodes. Let’s use the MATCH clause to see the nodes.
Output:
The above command shows only nodes because there is no relationship between them.
Show Nodes and Relationships
Let’s first create some nodes and relationships in the Neo4j database. Here we create 3 nodes and 2 relationships.
Now use the MATCH clause with RETURN clause to see the nodes and relationship among them.
Output:
This example shows the nodes and relationship both.
Next TopicNeo4j Optional Match Clause