Setting Parameters

You have been given the following query which finds all users with a name beginning with the string value supplied in the $name parameter.

cypher
MATCH (p:Person)-[:ACTED_IN]->(m:Movie)
WHERE p.name STARTS WITH $name
RETURN p.name AS actor,
m.title AS title

Set the $name Parameter

What command would you run in Neo4j Browser to set the $name parameter to Tom? (use double-quotes for the value of the parameter)

  • ✓ :param name: "Tom"

Hint

The :param command allows you to set a parameter which is persisted as long as the browser window is open. The format is as follows:

cypher
:param key: "value"

What command would you run in Neo4j Browser to set the $name parameter to Tom? (use double-quotes for the value of the parameter)

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

Solution

This is the command you use to set the $name parameter to Tom:

cypher
:param name: "Tom"

What command would you run in Neo4j Browser to set the $name parameter to Tom? (use double-quotes for the value of the parameter)

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

Summary

In this challenge, you correctly identified the code for setting a parameter within a Neo4j Browser session.

In the next challenge, you will rewrite a query to use a set of parameters.