Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-28-2020 12:02 AM
Learning CYPHER, so this is probably a beginner level question...
My Person node can have an arc to an A node, which has a name. It can also have an arc to a B node, which likewise has a name. How do I find Persons who have at least one A arc and at least one B arc, so I can get the names from the A and B nodes?
09-28-2020 12:19 AM
Hello @jeg and welcome to the Neo4j community
This is a template, you can add labels to node, and relations type between node if they are useful 🙂
The query return the name of the Person and a list of names for a and b.
MATCH (a)--(p:Person)--(b)
RETURN p.name AS p_name, collect(a.name) AS a_names, collect(b.name) AS b_names
Regards,
Cobra
09-28-2020 09:32 PM
Thank you very much! That did indeed get me going, and I was able to whittle it down to the exact query.
All the sessions of the conference are now available online