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.

Giving conditions to Nodes

When i query " match (n:label{Name_1:'A'})
match (n)--(p)--(q)--(r)
return n,p,q,r"

But B receives connection from other nodes aswell, like

Here I want B to be given only when I query every node connected to B with a query like

" match (n:label{Name_1:'A '}),(m:label{Name_1:'F'}),(o:label{Name_1:'E'})
match (n)--(p)--(q)--(r)
return n,m,o,p,q,r"

Can we attain it?

2 REPLIES 2

Is it something like this what you are looking for:

match (n:Label)--(m:Label{name:'B'})--(o:Label{name:'C'})--(p:Label{name:'D'})
where n.name in ['A', 'E', 'F']
return n,m,o,p

Benoit_d
Graph Buddy

in order to assign a variable name to the expected node, you may "reuse" the p-node 'B' in a template extension

MATCH (n:Label{name:'A'})--(p:Label{name:'B'})--(q:Label{name:'C'})--(r:Label{name:'D'}), 
(o:Label{name:'E'})--(p)--(m:Label{name:'F'})
RETURN m,n,o,p,q,r

but same result as @ronny.de.winter