Count your Nodes and Relationships

 How many Nodes and relationships are in your Graph?

You could look on the left hand side of the Neo4j Browser, but that would be cheating.

For nodes:

MATCH (n) RETURN count(n)

For Relationships:

MATCH ()-[r]->() RETURN count(r)

The above CYPHER statements assume all nodes and relationships are to be counted. Once you start adding in labels and relationships you will filter the return values

For Outgoing Relationships:

MATCH (a)-[r]->() RETURN count(a)

This counts nodes with outgoing relationships only.

Comments

Popular posts from this blog

Property DataType - apoc.meta.type

Stopping and Starting the Neo4j Database

NULLS in Neo4j