> ## Documentation Index
> Fetch the complete documentation index at: https://new.docs.falkordb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CREATE

> Use the CREATE clause to add new nodes and relationships to FalkorDB graphs. Create single or multiple entities, set properties and labels, and build complete graph patterns.

The `CREATE` clause is used to introduce new nodes and relationships into the graph.

## Creating Nodes

The simplest example creates a single node without any labels or properties:

```sh theme={null}
CREATE (n)
```

You can create multiple entities by separating them with commas:

```sh theme={null}
CREATE (n),(m)
```

Create a node with a label and properties:

```sh theme={null}
CREATE (:Person {name: 'Kurt', age: 27})
```

## Creating Relationships

To add relationships between nodes, you typically match existing nodes first, then create the relationship. In this example, we find an existing source node and create a new relationship with a new destination node:

```sh theme={null}
GRAPH.QUERY DEMO_GRAPH
"MATCH (a:Person)
WHERE a.name = 'Kurt'
CREATE (a)-[:MEMBER]->(:Band {name:'Nirvana'})"
```

Here the source node `(a:Person)` is matched (bound), while the destination node `(:Band)` is unbound and will be created.

This query creates a new node representing the band Nirvana and a new `MEMBER` relationship connecting Kurt to the band.

## Creating Complete Patterns

You can create entire graph patterns in a single statement. All entities within the pattern that are not bound (matched) will be created:

```sh theme={null}
GRAPH.QUERY DEMO_GRAPH
"CREATE (jim:Person{name:'Jim', age:29})-[:FRIENDS]->(pam:Person {name:'Pam', age:27})-[:WORKS]->(:Employer {name:'Dunder Mifflin'})"
```

This query creates three nodes (Jim, Pam, and an Employer) and two relationships (FRIENDS and WORKS), establishing a complete graph pattern in one operation.

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Can I create nodes and relationships in a single query?">
    Yes. You can create entire graph patterns in one CREATE statement. All unbound entities in the pattern will be created as new nodes and relationships.
  </Accordion>

  <Accordion title="How do I create a relationship between existing nodes?">
    Use MATCH to find the existing nodes first, then CREATE the relationship: `MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'}) CREATE (a)-[:KNOWS]->(b)`.
  </Accordion>

  <Accordion title="What happens if I CREATE a node without a label?">
    FalkorDB allows creating nodes without labels using `CREATE (n)`. The node will exist in the graph but cannot be efficiently queried by label-based index scans.
  </Accordion>

  <Accordion title="Can I set properties during CREATE?">
    Yes. Include properties in curly braces: `CREATE (:Person {name: 'Alice', age: 30})`. Multiple properties are separated by commas.
  </Accordion>
</AccordionGroup>
