Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-10-2020 04:13 AM
Hello,
I am newbie in neo4j. I want to select one hop distance nodes with some conditions
so Here Node A has two adjacent nodes B and C . and C here connected with D by relationship Pay
I will take only B here cause. I will select those node which don't have 'pay' relationship with other nodes.
so far I have done this
Match (c:ID:'064'})-[r:SEND | AIRS]->(d) return distinct(d).ID as RecieverID
so it gives me one hop distance neighbour those have 'send' and 'air' relationship. but some of this neighbour nodes has pay relationship with other nodes. I don't want to include this nodes .My desire out put is to obtain those adjacent neighbour which don't have 'Pays' relationship with other nodes
How could I solve this. any guidance and approaches are highly appreciated
05-10-2020 04:34 AM
To exclude a pattern that must not exist you have to use WHERE NOT
:
Match (c:ID:'064'})-[r:SEND | AIRS]->(d)
WHERE NOT (d)-[:PAYS]->()
return distinct(d).ID as RecieverID
All the sessions of the conference are now available online