Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-22-2018 07:27 PM
bin/neo4j-shell
allows for a command line interface to query your graph via Cypher statements and to include parameters to those statements.
Usage of parameters, rather than hard coding values, will allow for re-use of the query plan cache.
A parameter can be defined within neo4j-shell via the export command, for example:
neo4j-sh (?)$ export p1="Nora Ephron"
Multi-word values for parameters should be enclosed in double quotes. +
Parameters can be displayed within neo4j-shell via the env command, for example:
neo4j-sh (?) export p1="Nora Ephron"
neo4j-sh (?) env
TITLE_MAX_LENGTH=40
p1=Nora Ephron
TITLE_KEYS=.name.,.title.
Once a parameter is defined, it can be used in a Cypher statement, for example:
neo4j-sh (?) export p1="Nora Ephron"
neo4j-sh (?) env
TITLE_MAX_LENGTH=40
p1=Nora Ephron
TITLE_KEYS=.name.,.title.
neo4j-sh (?)$ match (n:Person {name:'Tom Hanks'})-[:ACTED_IN]->(n1:Movie)<-[:DIRECTED]-(n2:Person {name:{p1}}) return n1.title;
All the sessions of the conference are now available online