Taiwan Movies

Using UNWIND pass on intermediate results

Using the query you just created, answer this question:

Movies released in Taiwan?

How many movies released in Taiwan are in the graph?

  • ✓ 17

Hint

The query you executed in the last challenge should answer this question:

cypher
MATCH (m:Movie)
UNWIND m.countries AS country
WITH m, trim(country) AS trimmedCountry
// this automatically, makes the trimmedCountry distinct because it's a grouping key
WITH trimmedCountry, collect(m.title) AS movies
RETURN trimmedCountry, size(movies)

How many movies released in Taiwan are in the graph?

Once you have entered the answer, click the Try Again button below to continue.

Solution

You can run the following query to find the answer:

cypher
MATCH (m:Movie)
UNWIND m.countries AS country
WITH m, trim(country) AS trimmedCountry
// this automatically, makes the trimmedCountry distinct because it's a grouping key
WITH trimmedCountry, collect(m.title) AS movies
RETURN trimmedCountry, size(movies)

How many movies released in Taiwan are in the graph?

Once you have entered the answer, click the Try Again button below to continue.

Summary

In this challenge, you answered another question about the graph.

In the next module, you will learn about subqueries in Cypher.