The simplest instruction to create a node is the following:
CREATE ()
It creates a node, without a label or a relationship.
We can check the content of the database after this statement with a simple MATCH query that will return all nodes of the graph:
MATCH (n)
RETURN n
Here, we are selecting nodes (because of the use of () ), and we are also giving a name, an alias, to these nodes: n. Thanks to this alias, we can refer to those nodes in later parts of the query, here only in the RETURN statement.
The result of this query is shown here:
OK, great. But a single node with no label nor properties is not sufficient for most use cases. If we want to assign a label to a node when creating it, here is the syntax to use:
CREATE (:Label)
That's already better! Now, let's create properties when creating the node:
CREATE (:Label {property1...