TuringDB home pagelight logodark logo
  • Discord
  • GitHub
  • Website
TuringDB

Get Started

  • Introduction
  • Get Started
  • Claude Code Skill
  • Commands

Concepts

  • Overview
  • A Columnar Graph Database
  • Versioning System
  • The DataPart System
  • Zero-Locking Architecture
  • Snapshots Isolation

Benchmarks

  • Results Summary
  • Technical Report

Query Language

  • Query Language
  • CheatSheet

Importing data

  • JSONL
  • CSV
  • Neo4j
  • GML
  • Parquet

Graph Development

  • Create Graph
  • Load Graph
  • Load External data
  • Create a Change
  • List Changes
  • Create Nodes and Edges
  • Update Properties
  • Submit a Change
  • Time Travel
  • Graph Examples

Vector Search

  • Vector Search

Graph Algorithms

  • Shortest Path

Tutorials

  • Example Notebooks

Python SDK

  • Get Started
  • Reference

Troubleshooting

  • Troubleshooting

  • Setting a single property
  • Setting multiple properties
  • Setting a property from an expression
  • Setting a property from another variable
  • Updating edge properties
  • Updating a specific node by internal ID
  • Using SET with WHERE
Graph Development

Update Properties

Use the SET clause to update properties on existing nodes and edges in TuringDB

The SET clause is used to update property values on existing nodes and edges. It is always used in combination with a MATCH clause that identifies the entities to update.

  • Cypher
  • Python SDK
// Update a single property
MATCH (n:Person {name: 'Alice'})
SET n.age = 30

// Commit the changes
COMMIT

​
Setting a single property

To update a property on a node or edge, use SET followed by a property assignment.

MATCH (n:Person {name: 'Alice'})
SET n.age = 30

This sets the age property of the matched node to 30. If the property does not already exist, it will be created.

​
Setting multiple properties

Multiple properties can be updated in a single SET clause by separating assignments with commas.

MATCH (n:Person {name: 'Alice'})
SET n.position = 'Developer', n.surname = 'Taylor'

​
Setting a property from an expression

The value assigned can be any expression, including arithmetic operations on existing properties.

MATCH (p:Product)
SET p.discountPrice = p.price * (1 - 0.15)

​
Setting a property from another variable

You can copy a property value from one matched entity to another.

MATCH (n:Person {name: 'Alice'}), (m:Person {name: 'Bob'})
SET n.age = m.age

​
Updating edge properties

Edge properties can be updated using the same syntax.

MATCH (n:Person {name: 'Alice'})-[e:KNOWS]->(m:Person {name: 'Bob'})
SET e.since = 2020

​
Updating a specific node by internal ID

Every node in TuringDB has an internal ID. You can target a specific node by comparing it directly to its ID in a WHERE clause. This is useful when you already know the exact node you want to update.

MATCH (n)
WHERE n = 1234
SET n.age = 42

​
Using SET with WHERE

SET can be combined with WHERE to update properties on nodes that match a condition.

MATCH (n:Person)
WHERE n.age < 18
SET n.isMinor = true

CREATE ... SET is not supported. When creating nodes or edges, use brace initialisation to set properties directly in the CREATE clause:

CREATE (:Person {name: 'Alice', age: 30})
# Update a single property
client.query("MATCH (n:Person {name: 'Alice'}) SET n.age = 30")

# Commit the changes
client.query("COMMIT")

Setting a single property

To update a property on a node or edge, use SET followed by a property assignment.

client.query("MATCH (n:Person {name: 'Alice'}) SET n.age = 30")

This sets the age property of the matched node to 30. If the property does not already exist, it will be created.

Setting multiple properties

Multiple properties can be updated in a single SET clause by separating assignments with commas.

client.query("MATCH (n:Person {name: 'Alice'}) SET n.position = 'Developer', n.surname = 'Taylor'")

Setting a property from an expression

The value assigned can be any expression, including arithmetic operations on existing properties.

client.query("MATCH (p:Product) SET p.discountPrice = p.price * (1 - 0.15)")

Setting a property from another variable

You can copy a property value from one matched entity to another.

client.query("""
MATCH (n:Person {name: 'Alice'}), (m:Person {name: 'Bob'})
SET n.age = m.age
""")

Updating edge properties

Edge properties can be updated using the same syntax.

client.query("""
MATCH (n:Person {name: 'Alice'})-[e:KNOWS]->(m:Person {name: 'Bob'})
SET e.since = 2020
""")

Updating a specific node by internal ID

Every node in TuringDB has an internal ID. You can target a specific node by comparing it directly to its ID in a WHERE clause. This is useful when you already know the exact node you want to update.

client.query("""
MATCH (n)
WHERE n = 1234
SET n.age = 42
""")

Using SET with WHERE

SET can be combined with WHERE to update properties on nodes that match a condition.

client.query("""
MATCH (n:Person)
WHERE n.age < 18
SET n.isMinor = true
""")

CREATE ... SET is not supported. When creating nodes or edges, use brace initialisation to set properties directly in the CREATE clause:

client.query("CREATE (:Person {name: 'Alice', age: 30})")
Create Nodes and EdgesSubmit a Change
githublinkedinyoutubediscord