Skip to content

Functions & operators

Identifier & metadata functions

FunctionReturns
id(n)Internal NodeId (i64-flavoured opaque)
n._idSame as id(n); accessor form
labels(n)list<string> of the node’s labels
type(r)string edge type
properties(n) / properties(r)map<string, any>
keys(n)list<string> of property names

Aggregations

FunctionNotes
count(*), count(expr), count(DISTINCT expr)
sum, avg, min, maxnumeric / lexicographic
collect(expr)list aggregation

String

FunctionExample
toUpper(s), toLower(s)
trim(s), ltrim(s), rtrim(s)
substring(s, start[, length])
replace(s, search, replacement)
split(s, delim)returns list<string>
startsWith(s, p), endsWith(s, p), contains(s, p)
s + tstring concatenation via +

Numeric

FunctionNotes
abs, sign, floor, ceil, round
sqrt, log, exp, pow(base, exp)
toInteger, toFloat

Date & time

FunctionNotes
date(), date($iso_string)Date
datetime(), datetime($iso_string)UTC µs DateTime
duration({days: 1, hours: 2})

List & map

FunctionNotes
size(list)length
head(list), tail(list), last(list)
range(start, end[, step])inclusive end
[x IN list WHERE pred]list comprehension
keys(map)list<string>
coalesce(a, b, c, ...)first non-null

Logical & comparison operators

OperatorNotes
AND, OR, NOT, XORshort-circuit on AND/OR
=, <>, <, <=, >, >=
IS NULL, IS NOT NULL
IN [list]hash-set membership
=~ '<regex>'regex match
+, -, *, /, %numeric
+also string concat

CASE

RETURN
CASE
WHEN p.age < 18 THEN 'minor'
WHEN p.age < 65 THEN 'adult'
ELSE 'senior'
END AS bucket

Path functions

FunctionNotes
length(path)number of edges
nodes(path)list<node>
relationships(path)list<rel>

See also