Cypher parameters in CLI cypher-script

With 3.5.8 running cypher-shell and then at the cypher-shell prompt entering :help returns

$ cypher-shell
Connected to Neo4j 3.5.8 at bolt://localhost:7687.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j> :help

Available commands:
  :begin    Open a transaction
  :commit   Commit the currently open transaction
  :exit     Exit the logger
  :help     Show this help message
  :history  Print a list of the last commands executed
  :param    Set the value of a query parameter
  :params   Prints all currently set query parameters and their values
  :rollback Rollback the currently open transaction

For help on a specific command type:
    :help command


For help on cypher please visit:
    https://neo4j.com/docs/developer-manual/current/cypher/

neo4j> :help param

usage: :param name => value

Set the specified query parameter to the value given

neo4j>

as such the syntax for setting params in cypher-shell is

:param name=>value

the following should suffice

 printf ":param test=>'tested' \nCREATE (:Meta {name: \$test});\n" | cypher-shell
1 Like