write transaction
A transaction that changes data, and so is routed to the leader of a cluster.
Example
A function that writes, run by execute_write.
python
def create_user(tx, email, encrypted, name):
return tx.run("""
CREATE (u:User {
userId: randomUuid(),
email: $email,
password: $encrypted,
name: $name
})
RETURN u
""",
email=email, encrypted=encrypted, name=name
).single()
with driver.session() as session:
result = session.execute_write(create_user, email, encrypted, name)execute_write sends the work to the leader, which is the one member of a cluster that accepts writes. The leader then copies the change to the others.
Lessons that use this term
The lesson and course links below open in a new tab.
No published lesson uses this term yet.