Hi im using neo4j to create a recipe database. There are recipe nodes, and ingredient nodes, and pantry nodes and contains relationship. Generally there are many recipes that contain many ingredients and only one or so pantries which contain a number of ingredients. I want to know what recipes contain the ingredients i have in the pantry. It would also be cool if i could order the recipes results such that the recipe with the most ingredient are display first
MATCH (pantry_a:Pantry {name: "pantry_a"})-[:Contains]->(i:Ingredient)
WITH COLLECT(i) AS pantry_ingredients
MATCH (r:Recipe)-[:Contains]->(i:Ingredient)
WITH pantry_ingredients, r, COLLECT(i) AS other_ingredients
WHERE ALL(x IN pantry_ingredients WHERE x IN other_ingredients)
RETURN r.name
But it returns nothing. Would appreciate any help
Cheers