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.

Get only the nodes multiple users all have in common

omerule
Graph Buddy

Good evening,
I have this graph:


I would like to get only the users and nodes all users have in common.
But don't know how to get the data.

How can I get - from all - users the nodes/directory "this one" all the users have in common?

Yours kindly
Omer
The Netherlands

2 REPLIES 2

Hi Omer,

If I've understood your question correctly, you want to get all the common user nodes that link between both directories tagged "this one"?

If so, something like this should do the job (based on your model above):

//specify the path pattern between the two nodes:
MATCH (:directory {name:"this one"})<--(:group)<--(u:user)-->(:group)-->(:directory {name:"this one"})
//return the user node names  that are across this pattern path
RETURN u.name;

Bear in mind that this is assuming the strict alternation between user--group--directory.

omerule
Graph Buddy

Thank you for the reply.
I know the users.
But I don 't know the directory "this one".

Is there a analyses possible to get only:
These users all share these nodes.

Mvrgr Omer