apoc.label.exists

Details

Syntax

apoc.label.exists(node, label)

Description

Returns true or false depending on whether or not the given label exists.

Arguments

Name

Type

Description

node

ANY

A node to check for the given label on.

label

STRING

The given label to check for existence.

Returns

BOOLEAN

Usage Examples

The examples in this section are based on the following graph:

CREATE (s1:Student {name: 'Priya'});
MATCH (s1:Student {name: 'Priya'})
RETURN apoc.label.exists(s1, "Student") AS output;
Results
output

TRUE

MATCH (s1:Student {name: 'Priya'})
RETURN apoc.label.exists(s1, "Teacher") AS output;
Results
output

FALSE