Documentation
¶
Overview ¶
Package atomic provides APOC atomic operations.
This package implements all apoc.atomic.* functions for atomic updates and operations on nodes and relationships.
Index ¶
- func CompareAndSwap(node *Node, property string, expected, newValue interface{}) bool
- type Node
- func Add(node *Node, property string, value interface{}) *Node
- func Concat(node *Node, property string, value string) *Node
- func Decrement(node *Node, property string) *Node
- func Increment(node *Node, property string) *Node
- func Insert(node *Node, property string, position int, value interface{}) *Node
- func Remove(node *Node, property string, position int) *Node
- func Subtract(node *Node, property string, value interface{}) *Node
- func Update(node *Node, property string, value interface{}) *Node
- type Relationship
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAndSwap ¶
CompareAndSwap atomically compares and swaps a property value.
Example:
apoc.atomic.compareAndSwap(node, 'status', 'pending', 'active') => success
Types ¶
type Node ¶
Node represents a graph node.
func Add ¶
Add atomically adds a value to a numeric property.
Example:
apoc.atomic.add(node, 'counter', 5) => updated node
func Concat ¶
Concat atomically concatenates a value to a string property.
Example:
apoc.atomic.concat(node, 'name', ' Jr.') => updated node
func Decrement ¶
Decrement atomically decrements a numeric property by 1.
Example:
apoc.atomic.decrement(node, 'counter') => updated node
func Increment ¶
Increment atomically increments a numeric property by 1.
Example:
apoc.atomic.increment(node, 'counter') => updated node
func Insert ¶
Insert atomically inserts a value into a list property.
Example:
apoc.atomic.insert(node, 'tags', 2, 'new-tag') => updated node
func Remove ¶
Remove atomically removes a value from a list property.
Example:
apoc.atomic.remove(node, 'tags', 1) => updated node