Having this model:
(:Person)-[:has]-(:Movie)
I need to get all the movies that an arbitrary group of people have but another one does not.
I started with:
MATCH (p1.Person {Name: 'Josh'})-[:has]->(m:Movie)
WHERE not exists ((p2:Person {Name: 'Carl'})-[:has]->(m))
RETURN COUNT(m)
And I get the number of movies that p1 has and p2 does not. The problem is that I need the same with groups, not individuals; something like:
MATCH (p1.Person {Name: ['Josh','Mark]})-[:has]->(m:Movie)
WHERE
not exists ((p2:Person {Name: ['Carl','Roger']})-[:has]->(m))
RETURN COUNT(m)
I would need an equivalent query that returns the movies that Josh AND Mark have and Carl AND Roger don't.
Any sugestion?