Querying for Null Values

Check for no tmdbId values

Find all Movie nodes in the graph that do not have a tmdbId property.

Complete the WHERE clause by replacing the ?????? to test if the Movie tmdbId property is null.

cypher
MATCH (m:Movie)
WHERE ???????
RETURN m

Which of the following movies do not have a tmdbId property?

  • ❏ Stay Alive

  • ✓ Red Chapel (Røde kapel)

  • ❏ House of Wax

  • ❏ Mickey Blue Eyes

Hint

Use IS NULL to test the m.tmdbId property.

Solution

The answer is Red Chapel (Røde kapel). This is the only movie in this list that does not have a tmdbId property.

You can run the following query to see the result:

cypher
MATCH (m:Movie)
WHERE m.tmdbId IS NULL
RETURN m

You can use :history to see your past commands and Cypher code.

Summary

In this challenge, you wrote and executed a basic query to test for null values.

In the next challenge, you will answer another question about the data in the graph.