Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-16-2020 02:57 AM
How to query out MATCH (a:company)-[:orders]->(:item)-[made_by]->(b:company)-[:orders]->(:item)-[made_by]->(:c:company) amd so on without creating a direct relationship between two company nodes.
07-18-2020 07:19 AM
Do you have access to the ID's of each company you're trying to query? If so you could probably do something like:
MATCH (s:startCompany {id: startID})-[o]->(i)->[m]->(e:endCompany{id: endID})
return s, o, i, m e
If you wanted to check for other companies in the middle you could add an optional match for companies as well.
This answer is based on this example from Stack Overflow https://stackoverflow.com/questions/38423683/get-all-relationships-for-a-node-with-cypher
If you know the count then it could be something like r*1..3
as well
All the sessions of the conference are now available online