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.

Query all complete net of a specific node

Dear Neo4j friends,
maybe someone can help me with a query.
I want to retrieve a complete net of a specific node. (All the nodes related somehow with a specific node).

Thank you in advance

8 REPLIES 8

Bennu
Graph Fellow

Hi @arturo.guerrero ,

Take a look on:

Hello Bennu,
thank you for your reply, but I´m not able to run APOC on the community edition I´m working with.

Hi @arturo.guerrero !

You can always try:

MATCH(a)
WHERE //Set conditions here
WITH a
MATCH (a)-[*]->(b)
RETURN collect(b) as related

Bennu

Thank you Bennu,
I tried with your query, but I missed some information in return.
Then I tried to modify your query and instead I try this one:

MATCH(a)
WHERE //Set conditions here
WITH a
MATCH (a)-[*]-(b)
RETURN collect(b) as related

for returning bidirectional relationships, but trying this my server went down. Do you know why?
I´m only trying to find a way to have all the connection in a connected cluster and avoiding unconnected nodes.

Thank you

Hi @arturo.guerrero!

Did you set any condition on a? Otherwise you are going to query pretty much the entire db and you may have OOM problems (out of memory).

Bennu

yes I set a condition on a . I set WHERE id(a) = (a node id-number).

Thank you

Hi @arturo.guerrero!

Can you confirm with the log that it was a OOM problem?

How much ram do you have? How big is the DB/xpected result of the query?

Can you use APOC library on your db?

Bennu

Dear Bennu,
the RAM is about 8 GB, but my graph has in total only 161 nodes. No so much I think.
I can´t use APOC, because I haven´t access to the server directly.

Thank you