Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-16-2022 09:06 AM
09-16-2022 09:08 AM
Sorry about the format of the table. It looked ok before I posted
09-16-2022 11:15 AM
I used the movie guide available in desktop. I am assuming it is the same data as in the class. I used this query. It returned a "A Few Good Men" with 12 actors.
match(a:Person)-[:ACTED_IN]->(m:Movie)
with m, collect(a.name) as actors
return m.title, actors, size(actors) as cnt
order by cnt desc
limit 1
09-16-2022 11:30 AM
I just ran the same query in the intermediate cypher course sandbox. It returned 'toy story' with a count of 4.
09-16-2022 02:42 PM
Thanks @glilienfield for taking the time to investigate. Unfortunately the course Movie appears to be different to the alternative you tried since 'A Few Good Men' did not satisfy the verification step. I also got the answer 'Toy Story' from the course sandbox version so you seem to have confirmed my issue!
Looks like the course needs a fix!
09-17-2022 04:09 PM
I decided to take the course, as I have not taken this one yet and you got me curious. I got through the question. Here was my query. The answer was "Hamlet'
match(p:Person)-[:ACTED_IN]->(m)
return m.title, size(collect(p.name)) as cnt
order by cnt desc
limit 1
I figured out the difference. In my original query I grouped on the Movie node 'm', which collects the actors for that specific movie. In the query above, I grouped on 'm.title', which collects that actors over all Movie nodes with the same title. As it turns out, there are six movie nodes with the same title of 'Hamlet', so all the actors across all the 'Hamlet' movies get collected. This is why there are 24 actors related to the movie title 'Hamlet'.
All the sessions of the conference are now available online