1.2.3. Values and types

This section describes how to work with values and types when programming user-defined procedures and functions.

The input and output to and from a procedure or a function must be one of the supported types, as described in Cypher Manual → Values and types.

Composite types are supported via:

The use of Object is supported for the case where the type is not known beforehand. Note, however, that the actual value must still have one of the aforementioned types.

The Cypher types and their equivalents in Java are outlined in the table below:

Table 1.1. Supported types
Cypher type Java type

String

String

Integer

Long

Float

Double

Boolean

Boolean

Point

org.neo4j.graphdb.spatial.Point

Date

java.time.LocalDate

Time

java.time.OffsetTime

LocalTime

java.time.LocalTime

DateTime

java.time.ZonedDateTime

LocalDateTime

java.time.LocalDateTime

Duration

java.time.temporal.TemporalAmount

Node

org.neo4j.graphdb.Node

Relationship

org.neo4j.graphdb.Relationship

Path

org.neo4j.graphdb.Path

For more details, see the API documentation.

Take note that there are two cases where more than one Java type is mapped to a single Cypher type. When this happens, type information is lost. If the following objects are returned from procedures, the original types cannot be recreated: