Functions & operators
Identifier & metadata functions
| Function | Returns |
|---|---|
id(n) | Internal NodeId (i64-flavoured opaque) |
n._id | Same 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
| Function | Notes |
|---|---|
count(*), count(expr), count(DISTINCT expr) | |
sum, avg, min, max | numeric / lexicographic |
collect(expr) | list aggregation |
String
| Function | Example |
|---|---|
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 + t | string concatenation via + |
Numeric
| Function | Notes |
|---|---|
abs, sign, floor, ceil, round | |
sqrt, log, exp, pow(base, exp) | |
toInteger, toFloat |
Date & time
| Function | Notes |
|---|---|
date(), date($iso_string) | Date |
datetime(), datetime($iso_string) | UTC µs DateTime |
duration({days: 1, hours: 2}) |
List & map
| Function | Notes |
|---|---|
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
| Operator | Notes |
|---|---|
AND, OR, NOT, XOR | short-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 bucketPath functions
| Function | Notes |
|---|---|
length(path) | number of edges |
nodes(path) | list<node> |
relationships(path) | list<rel> |