Function names are case-insensitive (toUpper, toupper and TOUPPER
are the same). A function that is not listed here fails with
function name is not supported (HTTP 400, code: "unsupported").
Unless noted otherwise, a NULL argument gives a NULL result.
Operators
| Operator | Meaning | Example → result |
|---|
+ | Add numbers; concatenate strings or lists | 1 + 2 → 3, 'a' + 1 → 'a1', [1] + [2] → [1, 2] |
-, * | Subtract, multiply | 7 * 3 → 21 |
/ | Divide. Integer by integer truncates toward zero | 7 / 2 → 3, -7 / 2 → -3, 7.0 / 2 → 3.5 |
% | Remainder (sign of the dividend) | 7 % -3 → 1 |
^ | Power, always a float | 2 ^ 10 → 1024.0 |
-x | Negation | -3 |
= <> | Equality. 1 = 1.0 is true; lists and maps compare structurally | [1,2] = [1,2] → true |
< > <= >= | Ordering for numbers, strings, dates, datetimes. Incompatible types give NULL | 'abc' < 'abd' → true, 1 < 'a' → null |
AND OR XOR NOT | Three-valued logic | null AND false → false, null OR true → true |
IS NULL, IS NOT NULL | Null test | null IS NULL → true |
IN | List membership (NULL-aware) | 1 IN [1, null] → true, 2 IN [1, null] → null |
STARTS WITH, ENDS WITH, CONTAINS | String tests, case-sensitive | 'abc' CONTAINS 'b' → true |
=~ | Regular expression, must match the whole string. (?i) for case-insensitive | 'Alice' =~ '(?i)al.*' → true |
x[i] | List index, negative from the end | [1,2,3][-1] → 3 |
x[a..b], x[..b], x[a..] | List slice (end exclusive) | [1,2,3,4][1..3] → [2, 3] |
m.key, n.prop | Map key or property access | {a: 1}.a → 1 |
Integer arithmetic is 64-bit and wraps on overflow
(9223372036854775807 + 1 → -9223372036854775808). Float division by zero
gives Infinity, integer division by zero is an error.
Graph and identity
| Function | Returns |
|---|
id(x) | A node’s id as a UUID string; for a relationship, "<src>:<dst>". |
elementId(x) | A node’s id (UUID string); for a relationship, "<TYPE>-<src>-><dst>". |
labels(n) | List of the node’s labels, sorted. |
type(r) | The relationship type. |
keys(x) | Property keys of a node, relationship or map. |
properties(x) | Property map of a node or relationship. |
nodes(p), relationships(p) | The nodes / relationships of a path. |
length(p) | Number of relationships in a path. |
n._id reads the node id as a property, and MATCH (n:Label {_id: $id})
looks a node up by it.
Lists
| Function | Returns | Example → result |
|---|
size(x) | Length of a list or string (characters), map size, or a vector’s dimension | size('héllo') → 5 |
head(l), last(l) | First / last element, null for an empty list | head([1,2]) → 1 |
tail(l) | All but the first element | tail([1,2,3]) → [2, 3] |
reverse(x) | Reversed list or string | reverse([1,2,3]) → [3, 2, 1] |
range(start, end[, step]) | Inclusive integer range | range(0, 10, 3) → [0, 3, 6, 9], range(5, 1, -2) → [5, 3, 1] |
coalesce(a, b, …) | First non-null argument | coalesce(null, 3) → 3 |
List expressions:
| Form | Example → result |
|---|
[x IN list WHERE pred | expr] | [x IN range(1,5) WHERE x % 2 = 1 | x * 10] → [10, 30, 50] |
any / all / none / single(x IN list WHERE pred) | single(x IN [1,2] WHERE x = 2) → true |
reduce(acc = init, x IN list | expr) | reduce(s = 0, x IN [1,2,3] | s + x) → 6 |
[(a)-[:T]->(b) | b.name] (pattern comprehension) | list of the matched names, per row |
Strings
| Function | Example → result |
|---|
toUpper(s), toLower(s) | toUpper('straße') → 'STRASSE' |
trim(s), ltrim(s), rtrim(s) | trim(' a ') → 'a' |
left(s, n), right(s, n) | left('abc', 2) → 'ab' |
substring(s, start[, length]) | substring('hello', 1, 3) → 'ell' |
replace(s, search, replacement) | replace('aXbX', 'X', '-') → 'a-b-' |
split(s, delimiter) | split('a,b', ',') → ['a', 'b'] |
reverse(s) | reverse('ab') → 'ba' |
size(s) | Number of characters |
Conversion
| Function | Behaviour |
|---|
toString(x) | Text form of a number, boolean, string, date or datetime (toString(date('2026-11-01')) → '2026-11-01'). |
toInteger(x) | From a string or number; floats truncate toward zero (3.7 → 3). Unparseable input → null. |
toFloat(x) | From a string or number. Unparseable → null. |
toBoolean(x) | From 'true' / 'false' (case-insensitive), a boolean, or the integers 0 / 1. Anything else → null. |
toStringOrNull, toIntegerOrNull and the other …OrNull variants are
not implemented; the plain functions already return null for input they
cannot parse.
Math
| Function | Notes |
|---|
abs(x) | Same type as the input. |
sign(x) | -1, 0 or 1 (integer). |
round(x), floor(x), ceil(x) | Return a float. round takes one argument (no precision argument); halves round away from zero. |
sqrt(x) | Float; sqrt(-1) is NaN. |
Not implemented: exp, log, log10, e, pi, rand, sin and the
other trigonometric functions.
Dates and times
| Function | Returns |
|---|
date() | Today (UTC) as a DATE. |
date('YYYY-MM-DD') | A DATE. Invalid dates are an error. |
datetime() | Now as a UTC DATETIME (microsecond precision). |
datetime('ISO-8601') | A UTC DATETIME. Offsets are converted ('2026-11-01T10:00:00+02:00' → 08:00 UTC); a bare date means midnight UTC. |
localdatetime(…) | Same as datetime(…), interpreted as UTC. |
timestamp() | Milliseconds since the Unix epoch, as an integer. |
Dates and datetimes compare with <, = and friends and sort correctly.
Map arguments (date({year: 2026, …})), component access (d.year returns
null), duration, time and zoned types are not supported. Store
instants as DATETIME or as epoch integers.
Vectors and text scoring
| Function | Returns |
|---|
vector(list) | A dense float vector. size(v) is its dimension. |
cosine_similarity(a, b) | Cosine similarity; higher is closer. NULL when either vector has zero magnitude. |
dot_product(a, b) | Dot product; higher is closer. |
euclidean_distance(a, b) | Euclidean (L2) distance; lower is closer. |
bm25(text, query) | A per-row BM25 score of text against query, without corpus-wide statistics. |
The vector functions accept vectors or float lists and require equal
dimensions (otherwise an error). A KNN written as
ORDER BY cosine_similarity(n.embedding, $q) DESC LIMIT k uses a vector index
when one exists; see Search.
Aggregates
| Function | Notes |
|---|
count(*) | Rows in the group. |
count(x) | Non-null values. |
sum(x) | 0 for no values. |
avg(x) | Float; null for no values. |
min(x), max(x) | Numbers, strings, dates. |
collect(x) | List of non-null values. |
stdev(x), stdevp(x) | Sample / population standard deviation. |
percentileCont(x, p), percentileDisc(x, p) | p between 0.0 and 1.0; interpolated / nearest value. |
Every aggregate takes DISTINCT: count(DISTINCT n.city),
collect(DISTINCT n.age). Grouping keys are the non-aggregated items of the
same RETURN or WITH.