Let's say we have nodes that has an array property.
Node 1 fruits = ['apple','mango']
Node 2 fruits = ['apple']
Node 3 fruits = ['tomato']
and we want to find all nodes wherein one of their fruits exists in Maria's basket.
Maria's basket = ['orange','grape','apple']
So our end result would be : Node 1 and Node 2.
My approach would be matching all nodes whose elements of its fruits array exists with Maria's basket. But I couldn't get it to work
match (n) where x in n.fruits in ['orange','grape','apple'] return n
I tried the query above and returns syntax error since x is not defined. How do we properly approach this problem?
The second approach I'm thinking is, match all nodes if there is a UNION that exists between a node's fruits and Maria's fruits.