Submitting multiple semi-colon separated Cypher statements through Neo4j Browser

Dirk Calloway picture Dirk Calloway · Dec 6, 2013 · Viewed 17.5k times · Source

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?

Answer

jpenna picture jpenna · Aug 30, 2019

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