apoc.meta.cypher.isType

Details

Syntax

apoc.meta.cypher.isType(value, type)

Description

Returns true if the given value matches the given type.

Arguments

Name

Type

Description

value

ANY

An object to check the type of.

type

STRING

The verification type.

Returns

BOOLEAN

Check types using Cypher

Cypher can check types without the use of APOC.

Cypher syntax for checking a type
RETURN 1.0 IS :: INTEGER;

For more information, see the Cypher Manual → Type predicate expressions.

Usage Examples

The example below demonstrates how to use Cypher and APOC to test types:

  • apoc.meta.cypher.isType
  • Type predicate expression
apoc.meta.cypher.isType
RETURN apoc.meta.cypher.isType(1, "NODE") AS output;
Type predicate expression
RETURN 1 IS :: NODE AS output;
Results
output

false

  • apoc.meta.cypher.isType
  • Type predicate expression
apoc.meta.cypher.isType
RETURN apoc.meta.cypher.isType(datetime(), "DATE_TIME") AS output;
Type predicate expression
RETURN datetime() IS :: ZONED DATETIME AS output;
Results
output

true