Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-10-2019 11:21 AM
Hi there,
If I have a set of nodes that have a unique constraint on the node name and I want to match more than one node by different names and got all the nodes that have relationships to these nodes together. How can I do it?
Example:
Node (Name):
James
Jack
David
Node (Food):
Pizza
Pasta
Sushi
And I have different relationships based on what food everyone like. How can I match the mutual food that only both David and James like?
Thanks
04-10-2019 12:47 PM
Try something like this:
MATCH (p:Person)-[:LIKES]->(f:Food)
Where p.name = "David"
WITH p, f
MATCH (p1:Person)-[:LIKES]->(f) Where p1.name = "James"
RETURN p.name, p1.name, f.name;
All the sessions of the conference are now available online