Values and types

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:

  • List<T>, where T is one of the supported types, and

  • Map<String, Object>, where the values in the map must have one of the supported types.

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.

Table 1. Supported Cypher types and their equivalents in Java
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

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:

  • A Cypher Duration is created when either java.time.Duration or java.time.Period is provided. If Duration is returned, only the common interface java.time.temporal.TemporalAmount remains.

  • A Cypher DateTime is created when java.time.OffsetDateTime is provided. If DateTime is returned, it is converted into java.time.ZonedDateTime.