Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MATCH (n) RETURN n

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use the following query:

MATCH (n)
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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading