Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-03-2020 10:05 AM
Dear Everyone,
I literally copy paste the following from the help file and got a syntax error. Am I missing something?
:param name => 'Stella'
MATCH (n:Person) WHERE n.name = $name
return t
Here is the error message
Syntax error at line 2 col 0:
MATCH (n:Person) WHERE n.name = $name
^
Unexpected "\n".
I am attempting to understand parameters and why they are necessary or when to use them.
12-03-2020 12:06 PM
Hi @tideon ,
You need to set the parameter(name to 'Stella') first by running it separately:
:param name => 'Stella'
And now use the parameter in Cypher query-
MATCH (n:Person) WHERE n.name = $name
return n
Using parameters, rather than hard coding values, will allow for reuse of the query plan cache.
12-03-2020 12:34 PM
And is the param in the background untime you restart the database? The information in the manual isn't clear about what it entails.
12-03-2020 12:40 PM
Also thank you Akaur for the answer.
The manual doesn't mention these types of little details.
All the sessions of the conference are now available online