I have a simple Neo4j graph database that I created while trying to model something for a new application. When I run the following query, I get the nodes that I am expecting, but I also get more relationships than I bargained for:
MATCH (o:Office)-[r:REPORTS_VARIABLE_TO]->()
RETURN o,r
This is what the results look like:
Since I specifically requested things that match with [:REPORTS_VARIABLE_TO]
I expected to see only that relationship in the results. What I see, though, is all relationships that exist between any matching nodes (as you can see on the bottom of the image).
Is there a way to filter out those relationships that are not of the type I'm looking for?
Neo4j Browser is the easiest way to access a Neo4j database. To establish a connection, you enter the DBMS URL, the name of the database you want to connect, and the user credentials. You can also use the :server command to manage the connection to Neo4j. For more information, see Manage connection commands.
When you want to return all nodes, relationships and paths found in a query, you can use the * symbol. This returns the two nodes, the relationship and the path used in the query.
The guide drawer contains interactive Neo4j Browser guides for learning concepts and tools with Neo4j. Show the guide drawer with a specific Neo4j Browser guide. The name can be specified with or without the Hyphen ( - ) character, e.g, :guide movie-graph or :guide movie graph .
Launch Neo4j Browser If you are running Neo4j in another environment, Neo4j Browser is available via HTTP at http://localhost:7474 and HTTPS at https://localhost:7473 , substituting the right address for your environment.
Using Neo4j Desktop 1.3.8 and the Neo4j Browser, you need to uncheck the setting "Connect result nodes".
For the newest versions (e.g 3.2, 3.3) the "auto-complete" toggle has been moved to the browser settings and its new name is "Connected all results". If it is checked, it connects nodes with all of their relationships. Otherwise, you only see relationships which meet the filtering criteria.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With