CREATE
CREATE (a:Person {name: 'Alice', age: 30})-[:KNOWS]->(b:Person {name: 'Bob', age: 25})Create nodes and relationships in one statement. Returns nothing unless you add RETURN.
Syntax#
CREATE (variable:Label {key: value, ...}) [RETURN variable]
CREATE (a:Label {props})-[:TYPE]->(b:Label {props})Examples#
Create a node#
CREATE (n:Person {name: 'Eve', age: 28}) RETURN nNotes#
- Node IDs are engine-assigned (monotonic
NodeId). - Properties are set at creation time. Use SET for mutations.
- For upsert semantics (find-or-create), use MERGE.
See Also#
Try it
Open ↗⌘↵ to run
Loading engine…