In this section, we will learn how to create nodes and relationships in our database. Let's start with the simplest example, that is, creating our first node. In the prompt, just type the following:
This command creates a node without properties or labels. It's equivalent to the following Java code:
Node n = graphDb.createNode();
The result panel now shows the result as Created 1 node, returned 0 rows in 825 ms.
The preceding command returned zero rows because we had no
RETURN clause. It just created an anonymous node in the database. This node is not very useful as it is, as it can be referenced only by an ID. However, the command lets us introduce the
CREATE clause. The
CREATE clause takes one argument: ...