apoc.label.exists

Function

apoc.label.exists(node Any, label String) - returns true or false depending on whether or not the given label exists.

Signature

apoc.label.exists(node :: ANY?, label :: STRING?) :: (BOOLEAN?)

Input parameters

Name Type Default

node

ANY?

null

label

STRING?

null

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;
Table 1. Results
output

TRUE

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

FALSE