Is there a way to use parameters in LOAD CSV command?

I have a Cypher script to populate a Neo4j (2.2.3) database. Currently, the names of all CSV files are hardcoded. Is there a way to parameterize CSV files if I would like to switch to another web server or switch to the local filesystem?

Update

I forgot to mention that my use case is via neo4j-shell. Is there a way to define parameters for use by the wrapper or can only be done through the REST API? Thank!

+3


source to share


2 answers


You can use parameters in the shell, just export them as environment variables. List them with env

:



export name=Tim
env
match (p:Person {firstName:{name}}) return p;

      

+1


source


Yes, the url of the CSV file is a string in the Cypher request, so you can parameterize it like any other Cypher request. Check out the docs here and here .



+1


source







All Articles