There is APOC apoc.coll.containsAll
function https://neo4j.com/labs/apoc/4.1/overview/apoc.coll/apoc.coll.containsAll/ But do we have something like containsAny
? If no, what should be used instead? I have two sets and would like to check if the first set contains any value from the second set.
I think you do not need APOC
for this.
Please try this:
MATCH (n)
WHERE any(element IN n.firstList WHERE element IN n.secondList)
RETURN n
Example on real values:
WITH [4,5,6,7] as second, [1,2,3,4] as first
RETURN ANY(element IN first WHERE element IN second)