0

Where can I find Memgraph's docs to list all distinct types of all created nodes and relationships from a graph in database? I found this: https://memgraph.com/docs/cypher-manual/connecting-nodes and if I create nodes and relationships using that - I'd like to know how to retrieve all distinct node types and relationships from that example.

MPesi
  • 212
  • 8

1 Answers1

0

You can get all the distinct labels with the following query:

MATCH (n) RETURN DISTINCT labels(n);

And you can get the relationship types with:

MATCH ()-[r]-() RETURN DISTINCT type(r);
MPesi
  • 212
  • 8