label
Labels are used to categorize nodes, and the label
module provides an array of utilities for working with labels in a Memgraph database.
Trait | Value |
---|---|
Module type | algorithm |
Implementation | C++ |
Graph direction | directed/undirected |
Edge weights | weighted/unweighted |
Parallelism | sequential |
Procedures
exists(node, label)
Checks whether a specified label exists within the provided node.
Input:
node: Any
➡ node whose labels are to be checked.label: string
➡ name of the label whose existence is to be confirmed.
Output:
exists: bool
➡ whether or not provided node has a specified label.
Usage:
CREATE (:Student {name: 'Ana'});
MATCH (s:Student {name: 'Ana'}) CALL label.exists(s, "Teacher") YIELD exists RETURN exists;
+----------------------------+
| exists |
+----------------------------+
| False |
+----------------------------+