Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Submitting multiple semi-colon separated Cypher statements through Neo4j Browser

Tags:

neo4j

cypher

I want to submit a list of semi-colon separated Cypher write statements via the web browser but I'm getting errors...

MERGE (a:user{id: 'A'}) 
MERGE (b:product{id: '1'}) 
CREATE UNIQUE (a)-[:USED_BY]->(b); 


MERGE (a:user{id: 'B'}) 
MERGE (b:product{id: '4'})  
CREATE UNIQUE (a)-[:USED_BY]->(b); 

I'm creating new nodes and referring to them in later relationship statements so I want to submit separate queries rather than one long one and I'd like to do this via Cypher.

What's the best way to do this?

like image 387
Dirk Calloway Avatar asked Dec 06 '13 09:12

Dirk Calloway


People also ask

What Neo4j browser command do you use to access a browser guide?

The guide drawer contains interactive Neo4j Browser guides for learning concepts and tools with Neo4j. Show the guide drawer with a specific Neo4j Browser guide. The name can be specified with or without the Hyphen ( - ) character, e.g, :guide movie-graph or :guide movie graph .

How do I access Neo4j from my browser?

Default URL to Neo4j Browser is http://localhost:7474/browser (use your web browser). Default connection URL to Neo4j is bolt://localhost:7687 . Neo4j Browser is available as a web application at https://browser.graphapp.io/.

How do I return all nodes and relationships in Neo4j?

Return all elements When you want to return all nodes, relationships and paths found in a query, you can use the * symbol.

What is Neo4j browser sync?

Neo4j Browser Sync is a feature that allows you to synchronize your favorites, styling, and settings to cloud storage, so you can share it across machines and browsers.


2 Answers

There is a simple setting to do this now: Enable multi statement query editor.

Then you can run multiple statements separated by semi-colons ;

neo4j screenshot with the setting highlighted and result of both statements above

like image 132
jpenna Avatar answered Sep 21 '22 12:09

jpenna


I found a solution at Multiple unrelated queries in Neo4j Cypher?

Simply put WITH count(*) as dummy between independent commands.

like image 41
NikoNyrh Avatar answered Sep 17 '22 12:09

NikoNyrh