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.
Asked
Active
Viewed 123 times
1 Answers
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