apoc.meta.cypher.types

Details

Syntax

apoc.meta.cypher.types(props)

Description

Returns a MAP containing the type names of the given values.

Arguments

Name

Type

Description

props

ANY

A relationship, node or map to get the property types from.

Returns

MAP

Usage Examples

Calling the function with a map input will return a map with the same keys, where the value of each key is the type of the value it had in the input map:

RETURN apoc.meta.cypher.types({
  item1: 2,
  item2: datetime(),
  item3: "Michael"
}) AS output;
Results
output

{item2: "DATE_TIME", item1: "INTEGER", item3: "STRING"}

Calling the function with an empty map will return an empty map:

RETURN apoc.meta.cypher.types({}) AS output;
Results
output

{}

Calling the function with an input value that is not a map, will return an empty map:

RETURN apoc.meta.cypher.types(1) AS output;
Results
output

{}