Create nodes and relationships

Create labeled nodes and connect them with properties using CREATE in FalkorDB

falkordb d97231a 2 files · 1.7 KB Updated

File contents

Create nodes and relationships

Create labeled nodes and connect them with properties in FalkorDB.

Usage

Use CREATE to add nodes with labels and properties, and establish relationships between them.

Example

redis-cli GRAPH.QUERY social "CREATE (alice:User {id: 1, name: 'Alice', email: 'alice@example.com'})
CREATE (bob:User {id: 2, name: 'Bob', email: 'bob@example.com'})
CREATE (alice)-[:FRIENDS_WITH {since: 1640995200}]->(bob)"

Notes

  • Nodes are labeled with :Label syntax (e.g., :User)
  • Properties are defined in curly braces using JSON-like syntax
  • Relationships are created with -> syntax and can have labels and properties
  • All commands use GRAPH.QUERY with the graph name as the first parameter

falkordb/skills/tree/main/cypher-skills/create-nodes-and-relationships commit d97231ae8b

Frequently asked questions

npx skillmds@latest add falkordb/create-nodes-and-relationships