Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

neo4j: What is the syntax to set cypher query parameters in the browser interface?

Tags:

neo4j

cypher

I am trying to run queries from the neo4j browser to reproduce results from my neo4j-javascript-driver client.

What is the syntax for defining query parameters in the neo4j b

I recently attended a neo4j training session in NYC where the trainer (David Fauth) did this, unfortunately, I did not take notes on it, since I figured that I could read-up on this online...but no success.

like image 962
Joel Stevick Avatar asked Feb 22 '17 16:02

Joel Stevick


People also ask

How do you pass a parameter to a Cypher query?

To set a parameter in Cypher Shell use :param name => 'Joe' . For more information refer to Operations Manual → Cypher Shell - Query Parameters. For Neo4j Browser use the same syntax as Cypher Shell, :param name => 'Joe' .

How can we use Neo4j Browser?

Neo4j Browser is the easiest way to access a Neo4j database. To establish a connection, you enter the DBMS URL, the name of the database you want to connect, and the user credentials. You can also use the :server command to manage the connection to Neo4j.


2 Answers

In neo4j-browser you need type for example:

:params {nodes: [{name: "John", age: 18}, {name: "Phill", age: 23}]} 

Then you can use params as usual:

UNWIND {nodes} as node MERGE (A:User {name: node.name, age: node.age}) RETURN A 

For clear params in neo4j-browser type :params {}.

For additional help type :help params.

like image 97
stdob-- Avatar answered Sep 23 '22 19:09

stdob--


In Neo4j-3.3.4, the cypher likes this:

:param nodes: [{name: 'John', age: 18}, {name: 'Phill', age: 23}] 

Neo4j Browser result: here

like image 41
Mr.QA Avatar answered Sep 19 '22 19:09

Mr.QA