Case Insensitive Search

Check movie titles

Find all the Movies where the title begins with "Life is".

You should ensure that the query is case-insensitive. e.g. also retrieve movies with titles such as "LIFE IS", "life is", "Life Is".

Update the WHERE clause to test if a Movie node has a title property that starts with "Life is".

cypher
MATCH (m:Movie)
WHERE ??????(m.title) ??????? '??????'
RETURN m.title

Select all the correct movies titles:

  • ✓ "Life Is Beautiful (La Vita è bella)"

  • ✓ "Life Is Sweet"

  • ❏ "LIFE IS LOUD"

  • ✓ "Life is a Miracle (Zivot je cudo)"

  • ✓ "Life Is Sacred"

  • ❏ "Life is a Long Quiet River"

Hint

You can use toLower() or toUpper() to test against "life is".

The clause STARTS WITH can be used to test if a string starts with a specific value.

Solution

The correct answers are:

  • "Life Is Beautiful (La Vita è bella)"

  • "Life Is Sweet"

  • "Life is a Miracle (Zivot je cudo)"

  • "Life Is Sacred"

You can run the following query to see the result:

cypher
MATCH (m:Movie)
WHERE toUpper(m.title) STARTS WITH 'LIFE IS'
RETURN m.title

Summary

In this challenge, you wrote and executed a query that will find property values, regardless of their case.

In the next challenge, you will answer another question.