Docs
View as markdown

Types and values

Every value type relate handles, with its literal syntax, ranges, null rules, which types a property can store, and how each type prints in each output mode.

cyphercli

A value in relate has one of the types in the value types table: a number, a string, a boolean, a list, a map, a graph value, a temporal value, a point, a vector, a UUID or null. valueType(<expression>) names the type of any value, and the table's last column says which types a property A named value stored on a node or relationship, such as name: 'Ada'; values are scalars, temporal and spatial values, vectors, or lists of them. Read more in the glossary can store. The cells on this page run on relate's WebAssembly (WASM) build, and the bash verify blocks run on the CLI; both run the same engine.

Synopsis

42  -7  0x1F  0o17  1_000          INTEGER
3.5  .5  6.02e23  Infinity  NaN    FLOAT
'text'  "text"  s'{expr} text'     STRING
true  false                        BOOLEAN
null                               NULL
[1, 2, 3]                          LIST<…>
{name: 'Ada', since: 2024}         MAP
date('2026-11-08')  duration('P1D')  point({x: 1, y: 2})
vector([0.1, 0.2], 2, FLOAT32)  uuid('f066ecfc-5151-4121-8a36-b35e00d72918')

Value types

The type name is the one valueType() returns and the IS :: predicate takes (expressions); valueType() adds NOT NULL to every value that is not null.

TypeLiteral or constructorRange or formStored as a property
INTEGER42, -7, 0x1F, 0o17, 1_00064-bit signed: -9223372036854775808 to 9223372036854775807Yes
FLOAT3.5, .5, 1e3, Infinity, NaNIEEE 754 64-bitYes
STRING'…', "…", s'…{expr}…'Unicode; size() counts charactersYes
BOOLEANtrue, false—Yes
NULLnullThe absence of a valueNo: setting a property to null removes it
LIST<T>[1, 2, 3]Any values, mixed types allowedOnly a list whose elements are one storable type and none null
MAP{key: value}String keysNo
NODEA pattern variableLabels, properties, and an element idNo
RELATIONSHIPA pattern variableOne type, properties, and a start and end nodeNo
PATHp = (a)-[r]->(b)Alternating nodes and relationshipsNo
DATEdate('2026-11-08')A calendar dateYes
LOCAL TIMElocaltime('10:15:30')A time of day without a zoneYes
ZONED TIMEtime('10:15:30+01:00')A time of day with an offsetYes
LOCAL DATETIMElocaldatetime('2026-11-08T10:15:30')A date and time without a zoneYes
ZONED DATETIMEdatetime('2026-11-08T10:15:30Z')A date and time with an offset or a named zoneYes
DURATIONduration('P1Y2M3DT4H')Months, days, seconds and nanoseconds, kept apartYes
POINTpoint({x: 1, y: 2})Two or three coordinates in one coordinate reference systemYes
VECTOR<T>(n)vector([1, 2, 3], 3, INT8)n coordinates of one numeric typeYes
UUIDuuid('f066ecfc-5151-4121-8a36-b35e00d72918')128 bitsYes
Cypher
RETURN valueType(42) AS int, valueType(3.5) AS float, valueType('Ada') AS string,
       valueType(null) AS nothing, valueType([1, 2]) AS list, valueType({k: 1}) AS map,
       valueType(duration('P1D')) AS duration, valueType(vector([1, 2], 2, INT8)) AS vector
Recorded result
intfloatstringnothinglistmapdurationvector
"INTEGER NOT NULL""FLOAT NOT NULL""STRING NOT NULL""NULL""LIST<INTEGER NOT NULL> NOT NULL""MAP NOT NULL""DURATION NOT NULL""VECTOR<INTEGER8 NOT NULL>(2) NOT NULL"

1 row

Numbers

RuleDetail
Integer literalsDecimal, hexadecimal 0x1F, octal 0o17, with _ between digits (1_000)
Integer overflowA literal outside the range fails to parse: syntax error: IntegerOverflow: parse error: integer overflow: 9223372036854775808. Arithmetic past the range fails with type error: integer out of range
Float literalsA decimal point, an exponent or both: 3.5, .5, 6.02e23
Non-finite floatsInfinity, -Infinity and NaN; 1 / 0.0 is Infinity
Mixed arithmeticAn integer and a float give a float; ^ always gives a float
ConversionstoInteger() truncates toward zero; toFloat() widens (functions)
Cypher
RETURN 9223372036854775807 AS max_int, 0x1F AS hex, 0o17 AS octal, 1_000 AS grouped,
       1e3 AS exponent, toInteger(-3.9) AS truncated
Recorded result
max_inthexoctalgroupedexponenttruncated
9223372036854775807311510001000.0-3

1 row

Strings

A string literal is in single or double quotes. The escapes are \', \", \\, \n, \t and \uXXXX. An interpolated literal, s'…', evaluates each {<expression>} inside it; \{ and \} are literal braces, and an embedded null makes the whole string null. size() and char_length() count Unicode characters, so size('café') is 4.

Lists and maps

A list holds any values, of mixed types, null included; a map holds string keys and any values. Both exist only while a statement runs, with one exception: a list can be stored as a property when every element has the same storable type and none is null. Anything else fails the write with type error: InvalidPropertyType.

Value set as a propertyResult
[1, 2], [1.0, 2], ['a', 'b'], [true], [date('2026-01-01')], [point({x: 1, y: 1})]Stored; [1.0, 2] is stored as [1.0, 2.0]
[]Stored
[1, 'a'], [1, null]type error: InvalidPropertyType
{a: 1}type error: InvalidPropertyType
Cypher
CREATE (t:Sample {ints: [1, 2], floats: [1.0, 2], empty: []})
RETURN t.floats AS floats, valueType(t.floats) AS type, t.empty AS empty
Recorded result
floatstypeempty
[1.0, 2.0]"LIST<FLOAT NOT NULL> NOT NULL"[]

1 row · nodes created: 1, properties set: 3, labels added: 1

Cypher
CREATE (:Sample {settings: {a: 1}})
Expected error
error: type error: InvalidPropertyType

Graph values

A node An entity in the graph: it carries zero or more labels and a map of properties, and relationships connect it to other nodes. Read more in the glossary carries labels and properties, a relationship A directed, typed connection between two nodes, with properties of its own; every relationship has exactly one type and a start and an end node. Read more in the glossary carries one type, properties and its two end nodes, and a path An alternating sequence of nodes and relationships that a pattern matched, bound with p = … and read with nodes(p), relationships(p) and length(p). Read more in the glossary alternates nodes and relationships and starts and ends with a node. None of them can be stored as a property.

Each node and relationship has an element id The string elementId() returns for a node or relationship, such as 4:relate-neo4j:n0; it stays the same when the store is closed and opened again. Read more in the glossary, a string that elementId() returns: 4:relate-neo4j:n<k> for a node and 5:relate-neo4j:r<k> for a relationship. The middle segment names the namespace (relate-neo4j for neo4j), and db.nameFromElementId() returns that namespace. The middle segment was relate before 0.1.2: an id in that spelling, such as 4:relate:n0, matches no entity, and db.nameFromElementId() fails on it with No database corresponds to the given element id. id() returns the integer part and is deprecated; under EXPLAIN it raises notification 01N01 (notifications).

Cypher
CREATE (a:Sample {name: 'a'})-[r:LINKS]->(b:Sample {name: 'b'})
RETURN elementId(a) AS node_id, elementId(r) AS rel_id,
       db.nameFromElementId(elementId(a)) AS namespace
Recorded result
node_idrel_idnamespace
"4:relate-neo4j:n1""5:relate-neo4j:r0""neo4j"

1 row · nodes created: 2, relationships created: 1, properties set: 2, labels added: 2

Temporal types

TypeConstructor from a stringFrom a mapComponents
DATEdate('2026-11-08'), date('2026-W45-7'), date('20261108')date({year: 2026, month: 11, day: 8})year, quarter, month, week, weekYear, day, ordinalDay, dayOfQuarter, dayOfWeek (also weekDay)
LOCAL TIMElocaltime('10:15:30')localtime({hour: 10, minute: 15})hour, minute, second, millisecond, microsecond, nanosecond
ZONED TIMEtime('10:15:30+01:00')time({hour: 10, timezone: '+01:00'})The local time components, offset, offsetMinutes, offsetSeconds, timezone
LOCAL DATETIMElocaldatetime('2026-11-08T10:15:30')localdatetime({year: 2026, month: 11, day: 8, hour: 10})The date and time components
ZONED DATETIMEdatetime('2026-11-08T10:15:30+01:00'), datetime('2026-11-08T10:15:30[Europe/Paris]')datetime({year: 2026, month: 11, day: 8, timezone: 'Europe/Paris'}), datetime({epochMillis: 0})The date and time components, offset, offsetMinutes, offsetSeconds, timezone, epochSeconds, epochMillis
DURATIONduration('P1Y2M3DT4H5M6.5S')duration({days: 1, hours: 2})years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds; quartersOfYear, monthsOfQuarter, monthsOfYear, daysOfWeek, minutesOfHour, secondsOfMinute, millisecondsOfSecond, microsecondsOfSecond, nanosecondsOfSecond

A component is read with a dot: date('2026-11-08').dayOfWeek is 7, and .dayOfQuarter is 39. A component the type lacks fails with type error: no such component '<name>' on a <type> value, as date('2026-11-08').hour does. A duration keeps months, days and seconds apart and never converts between them: duration({days: 1, hours: 25}) is P1DT25H. A plural duration component counts its whole part in that unit, and an …Of… component the remainder below the next unit: for duration('P1Y2M3DT4H5M6.5S'), months is 14 and monthsOfYear is 2, minutes is 245 and minutesOfHour is 5. Called with no argument, each temporal constructor returns the current instant; functions lists the clock variants.

Temporal arithmetic

ExpressionResult
<instant> + <duration>, <instant> - <duration>An instant of the same type; a month step clamps to the end of a shorter month (date('2026-01-31') + duration('P1M') is 2026-02-28)
<duration> + <duration>, <duration> - <duration>A duration
<duration> * <number>, <duration> / <number>A duration
<instant> - <instant>type error: - type mismatch; duration.between(a, b) gives the difference
<instant> < <instant>Order of two values of the same type; a DATE against a ZONED DATETIME gives null
Cypher
RETURN date('2026-01-31') + duration('P1M') AS month_end,
       datetime('2026-11-08T10:00Z') + duration('PT90M') AS later,
       duration.between(date('2026-01-01'), date('2026-11-08')) AS between,
       duration({days: 1, hours: 25}) AS kept_apart, date('2026-11-08').dayOfWeek AS weekday
Recorded result
month_endlaterbetweenkept_apartweekday
"2026-02-28""2026-11-08T11:30:00Z""P10M7D""P1DT25H"7

1 row

Points

A point is built from a map. The keys choose the coordinate reference system (CRS), and srid or crs in the map can name it.

KeysCRSsridDistance
x, ycartesian7203Euclidean, in the coordinates' unit
x, y, zcartesian-3d9157Euclidean
longitude, latitudewgs-844326Meters on the sphere
longitude, latitude, heightwgs-84-3d4979Meters

Coordinates are floats: point({x: 1, y: 2}).x is 1.0. The components are x, y, z, longitude, latitude, height, crs and srid. Two points have no order, so < between them gives null, and point.distance() between two different CRSs gives null. A POINT INDEX serves point.distance() and point.withinBBox() filters (geospatial).

Cypher
RETURN point({x: 1, y: 2}) AS cartesian,
       point({latitude: 51.5, longitude: -0.1}).srid AS geo_srid,
       point.distance(point({x: 0, y: 0}), point({x: 3, y: 4})) AS distance
Recorded result
cartesiangeo_sriddistance
point({crs: "cartesian", srid: 7203, x: 1.0, y: 2.0})43265.0

1 row

Vectors

vector(<list or string>, <dimensions>, <coordinate type>) builds a vector. All three arguments are required, the list length must equal the dimensions, and the coordinate type is a bare keyword, not a string.

KeywordvalueType() elementCoordinates
INT8, INTEGER8INTEGER8Signed 8-bit; a value outside the range fails with type error: Overflow
INT16, INTEGER16INTEGER16Signed 16-bit
INT32, INTEGER32INTEGER32Signed 32-bit
INT, INT64, INTEGER, INTEGER64INTEGERSigned 64-bit
FLOAT32FLOAT3232-bit float
FLOAT, FLOAT64FLOAT64-bit float
FLOAT16, BFLOAT16—Preview feature float16-coordinate-types; off, it fails with semantic error: SemanticError: preview feature 'float16-coordinate-types' is not enabled: set RELATE_PREVIEW=float16-coordinate-types
RuleDetail
Type nameVECTOR<FLOAT32 NOT NULL>(3) NOT NULL for vector([0.1, 0.2, 0.3], 3, FLOAT32)
DimensionsThe value takes any length the list has, 0 included; a vector index takes vector.dimensions from 1 to 4096 (search)
Length mismatchtype error: vector() dimension does not match list
A float into an integer typeTruncated: vector([1.5], 1, INT8) holds 1
A null coordinatetype error: vector() coordinates must be numbers
A string coordinate typesyntax error: parse error: vector() third argument must be a coordinate type keyword
size(v), vector_dimension_count(v)The dimensions
toFloatList(v), toIntegerList(v)The coordinates as a list
Cypher
RETURN vector([1, 2, 3], 3, INT8) AS small, vector('[1.5, 2.5]', 2, FLOAT32) AS from_string,
       valueType(vector([0.1, 0.2], 2, FLOAT32)) AS type, size(vector([1, 2, 3], 3, INT8)) AS dims
Recorded result
smallfrom_stringtypedims
vector([1, 2, 3], 3, INTEGER8)vector([1.5, 2.5], 2, FLOAT32)"VECTOR<FLOAT32 NOT NULL>(2) NOT NULL"3

1 row

UUIDs

uuid('<36-character string>') parses a UUID and uuid(<high>, <low>) builds one from two 64-bit integers. uuid() with no argument returns a random UUID, and randomUUID() returns one as a STRING. On the WASM build, the random forms stop the engine with time not implemented on this platform; they run on the CLI and the clients. toString() and the output modes print the 36-character form; uuid.mostSignificantBits() and uuid.leastSignificantBits() return the halves.

Cypher
RETURN uuid('f066ecfc-5151-4121-8a36-b35e00d72918') AS parsed, uuid(0, 1) AS from_halves,
       valueType(uuid(0, 1)) AS type
Recorded result
parsedfrom_halvestype
"f066ecfc-5151-4121-8a36-b35e00d72918""00000000-0000-0000-0000-000000000001""UUID NOT NULL"

1 row

Null

null is the value of a missing property, an index past the end of a list and an OPTIONAL MATCH that found nothing. Most operators and functions give null when an argument is null; expressions gives the three-valued logic and the exceptions. Every type includes null unless it is written NOT NULL, so null IS :: INTEGER is true.

Output modes

Each CLI output mode prints the same values in its own form (output modes). JSON, JSON Lines (jsonl) and the envelope share one value form; a row object's keys print in sorted order.

Typejson, jsonl, envelopeTOONcsvtable, markdown
INTEGER42424242
FLOAT3.5, 2.0, 1e+203.53.5; 1e20 prints as 100000000000000000000.03.5
Non-finite FLOAT"Inf", "-Inf", "NaN" (strings)"Inf", "NaN"Inf, NaNInf, NaN
STRING"Ada"Ada; quoted as JSON when it would read back as another type ("true", "42") or holds a commaAda; quoted when it holds a comma or a quote"Ada"
BOOLEANtruetruetruetrue
NULLnullnullan empty field<null>
LIST[1,"two"][1,"two"]"[1, ""two""]"[1, "two"]
MAP{"k":1}{"k":1}{k: 1}{k: 1}
NODE{"id":0,"kind":"node","labels":["Person"],"properties":{"name":"Ada"}}The JSON form(:Person {name: "Ada"})(:Person {name: "Ada"})
RELATIONSHIP{"end_node":1,"id":0,"kind":"relationship","properties":{…},"start_node":0,"type":"KNOWS"}The JSON form[:KNOWS {since: 2024}][:KNOWS {since: 2024}]
PATHA JSON array of the node and relationship objectsThe JSON form(:Person …)-[:KNOWS …]-(:Person …)Same as csv
Temporal typesISO 8601 strings: "2026-11-08", "10:15:30+01:00", "2026-11-08T10:15:30+01:00[Europe/Paris]", "P1DT2H30M"The ISO string, bareThe ISO stringThe ISO string
POINT{"crs":"cartesian","srid":7203,"x":1.0,"y":2.0}The JSON formpoint({srid: 7203, x: 1, y: 2})Same as csv
VECTOR{"dim":3,"type":"INTEGER8","values":[1,2,3]}The JSON formvector([1, 2, 3], 3, INTEGER8 NOT NULL)Same as csv
UUID"f066ecfc-5151-4121-8a36-b35e00d72918"The string, bareThe string"f066ecfc-…"

In csv, a field that starts with =, +, - or @ gets a leading ', so a spreadsheet does not read it as a formula: -0.0 prints as '-0.0. The cypher mode prints rows as CREATE statements and leaves out a VECTOR column with the comment // column v (VECTOR) omitted: no Cypher literal form.

The scalars and collections in JSON, TOON and CSV. In json, the row sits in the result object's data key. The json, jsonl and toon examples on this page also print the statement's timings and plan-cache outcome, whose numbers change from run to run:

relate --mode json "RETURN 42 AS int, 3.5 AS float, 'Ada' AS string, true AS bool, null AS nothing, [1, 'two'] AS list, {k: 1} AS map"
{"data":[{"bool":true,"float":3.5,"int":42,"list":[1,"two"],"map":{"k":1},"nothing":null,"string":"Ada"}],"planCache":"miss","timings":{"elapsed_ms":0.553208,"execute_ms":0.388125,"lex_parse_ms":0.026042,"lower_ms":0.033167,"parse_ms":0.110167,"plan_ms":0.043833,"result_generation_ms":0.000417,"rewrite_ms":0.007}}
relate --mode toon "RETURN 42 AS int, 3.5 AS float, 'Ada' AS string, true AS bool, null AS nothing, [1, 'two'] AS list, {k: 1} AS map"
rows[1]{int,float,string,bool,nothing,list,map}:
  42,3.5,Ada,true,null,[1,"two"],{"k":1}
timings:
  {"elapsed_ms":0.367209,"execute_ms":0.209583,"lex_parse_ms":0.023541,"lower_ms":0.031458,"parse_ms":0.107166,"plan_ms":0.040874999999999995,"result_generation_ms":0.000292,"rewrite_ms":0.00675}
planCache:
  miss
relate --mode csv "RETURN 42 AS int, 3.5 AS float, 'Ada' AS string, true AS bool, null AS nothing, [1, 'two'] AS list, {k: 1} AS map"
int,float,string,bool,nothing,list,map
42,3.5,Ada,true,,"[1, ""two""]",{k: 1}

The temporal types in JSON Lines and CSV:

relate --mode jsonl "RETURN date('2026-11-08') AS d, localtime('10:15:30') AS lt, time('10:15:30+01:00') AS t, localdatetime('2026-11-08T10:15:30') AS ldt, datetime('2026-11-08T10:15:30[Europe/Paris]') AS dt, duration('P1DT2H30M') AS dur"
{"d":"2026-11-08","dt":"2026-11-08T10:15:30+01:00[Europe/Paris]","dur":"P1DT2H30M","ldt":"2026-11-08T10:15:30","lt":"10:15:30","t":"10:15:30+01:00"}
{"planCache":"miss","timings":{"elapsed_ms":0.386625,"execute_ms":0.1875,"lex_parse_ms":0.023958,"lower_ms":0.090042,"parse_ms":0.15275,"plan_ms":0.038875,"result_generation_ms":0.0005,"rewrite_ms":0.009125}}
relate --mode csv "RETURN date('2026-11-08') AS d, localtime('10:15:30') AS lt, time('10:15:30+01:00') AS t, localdatetime('2026-11-08T10:15:30') AS ldt, datetime('2026-11-08T10:15:30[Europe/Paris]') AS dt, duration('P1DT2H30M') AS dur"
d,lt,t,ldt,dt,dur
2026-11-08,10:15:30,10:15:30+01:00,2026-11-08T10:15:30,2026-11-08T10:15:30+01:00[Europe/Paris],P1DT2H30M

Points, vectors and UUIDs in JSON Lines and CSV:

relate --mode jsonl "RETURN point({x: 1, y: 2}) AS xy, point({latitude: 51.5, longitude: -0.1}) AS geo, vector([1, 2, 3], 3, INT8) AS v, uuid('f066ecfc-5151-4121-8a36-b35e00d72918') AS u"
{"geo":{"crs":"wgs-84","latitude":51.5,"longitude":-0.1,"srid":4326},"u":"f066ecfc-5151-4121-8a36-b35e00d72918","v":{"dim":3,"type":"INTEGER8","values":[1,2,3]},"xy":{"crs":"cartesian","srid":7203,"x":1.0,"y":2.0}}
{"planCache":"miss","timings":{"elapsed_ms":0.443833,"execute_ms":0.24812499999999998,"lex_parse_ms":0.028541999999999998,"lower_ms":0.047666,"parse_ms":0.132542,"plan_ms":0.050083,"result_generation_ms":0.000458,"rewrite_ms":0.007417}}
relate --mode csv "RETURN point({x: 1, y: 2}) AS xy, point({latitude: 51.5, longitude: -0.1}) AS geo, vector([1, 2, 3], 3, INT8) AS v, uuid('f066ecfc-5151-4121-8a36-b35e00d72918') AS u"
xy,geo,v,u
"point({srid: 7203, x: 1, y: 2})","point({srid: 4326, x: -0.1, y: 51.5})","vector([1, 2, 3], 3, INTEGER8 NOT NULL)",f066ecfc-5151-4121-8a36-b35e00d72918

Graph values. This statement writes a node, a relationship and a path to the default in-memory store, which the process discards when it exits:

relate --mode jsonl "CREATE p = (a:Person {name: 'Ada'})-[r:KNOWS {since: 2024}]->(b:Person {name: 'Grace'}) RETURN a, r, p"
{"a":{"id":0,"kind":"node","labels":["Person"],"properties":{"name":"Ada"}},"p":[{"id":0,"kind":"node","labels":["Person"],"properties":{"name":"Ada"}},{"end_node":1,"id":0,"kind":"relationship","properties":{"since":2024},"start_node":0,"type":"KNOWS"},{"id":1,"kind":"node","labels":["Person"],"properties":{"name":"Grace"}}],"r":{"end_node":1,"id":0,"kind":"relationship","properties":{"since":2024},"start_node":0,"type":"KNOWS"}}
{"planCache":"miss","timings":{"elapsed_ms":0.528292,"execute_ms":0.303916,"lex_parse_ms":0.009042000000000001,"lower_ms":0.010541,"parse_ms":0.208167,"plan_ms":0.009917,"result_generation_ms":0.00029099999999999997,"rewrite_ms":0.000583}}

Column types in the envelope

The envelope's columnTypes names one type per column, with coarser names than valueType():

ValuecolumnTypes entry
INTEGER, FLOAT, STRING, BOOLEANINTEGER, FLOAT, STRING, BOOLEAN
nullANY
A list, a mapLIST, MAP
A node, a relationship, a pathNODE, RELATIONSHIP, PATH
DATE, DURATION, POINT, VECTORDATE, DURATION, POINT, VECTOR
LOCAL TIME, ZONED TIMETIME
LOCAL DATETIME, ZONED DATETIMEDATETIME
UUIDSTRING
relate --mode envelope "RETURN 42 AS int, null AS nothing, localtime('10:15:30') AS lt, uuid('f066ecfc-5151-4121-8a36-b35e00d72918') AS u, [1, 2] AS list"
{"columnTypes":["INTEGER","ANY","TIME","STRING","LIST"],"columns":["int","nothing","lt","u","list"],"notifications":[],"planCache":"miss","rows":[{"int":42,"list":[1,2],"lt":"10:15:30","nothing":null,"u":"f066ecfc-5151-4121-8a36-b35e00d72918"}],"timings":{"elapsed_ms":0.515875,"execute_ms":0.346709,"lex_parse_ms":0.023542,"lower_ms":0.043917,"parse_ms":0.11541699999999999,"plan_ms":0.044833000000000005,"result_generation_ms":0.0005,"rewrite_ms":0.006834},"truncated":false}

See also

  • Expressions: operators, comparison, the null rules, and type predicates.
  • Functions: constructors and conversions for every type.
  • Output modes: each mode's layout, headers, and defaults.
  • Search: vector and full-text indexes over these values.
  • Bi-temporal facts: temporal values in an agent's memory.