i want to write a query in cypher in order to find how many actors have acted in all of the movies in which brock lesnar has acted. My plan is to collect all the movies in which brocklesnar has acted and then loop through each of the movies and see if there are common actors in all of the movies. I am not able to write the query for the same. can anybody give me some suggestions to how to approach this problem?
match (a:`ACTOR` {name: 'Brock Lesnar'})-[:ACTS_IN]->(m:`MOVIES`) collect(m.title) as movies foreach(c in movies return (actor)-[:ACTS_IN]->(c))
this is what i have written so far. i know it is not right but this is where i am having the problem to code