How do I display all nodes with no defined labels

Although assigning a node one or more labels provides many benefits (i.e. performance gains from index usage, ability to group nodes into sets, etc), it is possible to create a node without any labels.

The following Cypher can be used to identify all nodes in the graph which have no label defined:

MATCH (n) WHERE size(labels(n)) = 0 RETURN n

Label usage is detailed here. ”’

  • Last Modified: 2020-09-15 13:07:09 UTC by Dana Canzano.
  • Relevant for Neo4j Versions: {neo4j-versions}.
  • Relevant keywords cypher.