Reputation: 627
I was going through Neo4j Manuals to get started with Neo4j.
So I installed Neo4j server and created my first node from the docs
CREATE (n:Actor { name:"Tom Hanks" });
As a node can have labels and properties. I interpreted the above query as creating a node with label Actor having one property name. And n means we are creating a node.
Then I come across this query CREATE (a { name : 'Andres' })
But what is that a in create(a:...) , what that a means.
Cypher syntax looks a bit weird.
Upvotes: 0
Views: 2099
Reputation: 2826
The syntax is CREATE (variablename:Label {propertyname:"propertyValue"})
The "n" in CREATE (n:Actor { name:"Tom Hanks" })
does not mean you are creating a node, it is just a variable name here. You can use that variable name further on in the same query if you want.
In CREATE (a { name : 'Andres' })
, the "a" is a variable name again. This time, a node is created without a label.
Upvotes: 4