47

How can I show all nodes and relationships in Data Browser tab?

What are sample index queries that I can type in in search field?

The Demz
  • 7,066
  • 5
  • 39
  • 43
gruber
  • 28,739
  • 35
  • 124
  • 216

7 Answers7

55

You may also want to try a cypher query such as:

START n=node(*) RETURN n;

It's very obvious, and it will return all the existing nodes in the database.

EDIT : the following displays the nodes and the relationships :

START n=node(*) MATCH (n)-[r]->(m) RETURN n,r,m;
Grégoire C
  • 1,361
  • 1
  • 13
  • 32
pimguilherme
  • 1,050
  • 11
  • 15
40

More simple way is

MATCH (n) RETURN (n)
Aniruddha Chakraborty
  • 1,849
  • 1
  • 20
  • 32
  • 1
    This is the proper way to produce all nodes and then the Data Browser Tab will magically add the relationships to the view. – The Demz Sep 26 '19 at 09:08
16
MATCH (n) OPTIONAL MATCH (n)-[r]-() RETURN n, r;
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Toothless Seer
  • 798
  • 9
  • 13
10

You can show everything with simple MATCH (n) RETURN n, as offical documentation suggests.

START n=node(*) RETURN n from Neo4j 2.0 is deprecated:

The START clause should only be used when accessing legacy indexes (see Chapter 34, Legacy Indexing). In all other cases, use MATCH instead (see Section 10.1, “Match”).

Adam Stelmaszczyk
  • 19,665
  • 4
  • 70
  • 110
9

There is a little help icon beside the search field, if you hoover over it it shows the syntax.

If a property of your nodes and relationships is indexed you can search for all of them like this.

node:index:indexname:fieldname:*
rels:index:indexname:fieldname:*
Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
5

I found that this worked, retrieving all nodes including orphans, and all relationships:

MATCH (n) MATCH ()-[r]->() RETURN n, r
sharon
  • 4,406
  • 1
  • 17
  • 10
  • 2
    As far as I can tell, that is a horrible query, since you don't include the match n node in the second match. It would probably end up with a Cartesian product returns A LOT of redundant data. Might I suggest: ```cypher MATCH (n) OPTIONAL MATCH (n)-[r]-(m) RETURN n,r,m ``` – larsw Oct 27 '17 at 08:27
1

Other good way for get ALL nodes (and nodes without relationship) :

MATCH (n) RETURN n UNION START n = rel(*) return n;
VincentLamoute
  • 800
  • 1
  • 9
  • 16