How to view all nodes along with all their relationships in AGE Viewer?

I have a graph for cities with 6 cities, and only two of them have a relationship between them. I would like to write a query that gives me all the cities along with all the relationships in between them.


The query above only gives me the nodes and not the relationships.
If I would like to have all the nodes along with all the relationships, what query may I use?
The query only outputs the nodes

I do have relationships as well

>Solution :

You can use the following query:

OPTIONAL MATCH (n)-[r]->(m)
RETURN n, r, m

This query will return all nodes (represented by n) and their relationships (represented by r and m). If a node doesn’t have any relationships, it will still be included in the results.

Leave a Reply