cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo4j cypher query to focus a node amongst the other nodes

sucheta
Graph Buddy

Hi,

I want to know is there a query where when i do

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

will return a set of all 125 nodes present in the database. Now here i want to generate a query where when i search a particular node amongst all the 125 nodes, it comes to focus or the centre of the neo4j.

Or probably if you can suggest an idea to get such an output.

1 ACCEPTED SOLUTION

You can certainly filter your queries by any label or property value in the graph. You can do so by adding a "WHERE" clause to your query. For example:

MATCH (n)-[r]->(m) where n.foo = 'xxx' return n, r, m

The online training course, Introduction to Neo4j has a lesson on getting more out of Cypher. You should take a look at this free training course.

Elaine Rosenberg

View solution in original post

2 REPLIES 2

You can certainly filter your queries by any label or property value in the graph. You can do so by adding a "WHERE" clause to your query. For example:

MATCH (n)-[r]->(m) where n.foo = 'xxx' return n, r, m

The online training course, Introduction to Neo4j has a lesson on getting more out of Cypher. You should take a look at this free training course.

Elaine Rosenberg

Thank you elaine ! I have been using this query for a while but it did not occur to me in this question. I shall take some time off and do the neo4j course. thanks