Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-27-2020 04:02 AM
Hello,
In Neo4j browser the following mutli statement succeeds, but doesn't show any output, neither in graph or table form
CREATE (a)
CREATE (b)
CREATE (a)-[:KNOWS]->(b);
MATCH (n) RETURN n
Obviously executing the last line separately show the expected two node graph.
Is there way that output could be created from a multi statement query? For demo purposes I want to store a big multi statement as a favourite and then execute it live with a big reveal at the end.
Thanks
Solved! Go to Solution.
03-29-2020 01:51 PM
Thanks Dana, That is a useful workaround. Not sure if it would work for all my scenarios, but i will use it where i can. Cees
03-27-2020 06:22 PM
via the browser if you run :play movies
which shows how to populate the movies graph, the 2nd slide of the carousel is similar to yours in that it performs many CREATE statements and then at the end it includes a
WITH TomH as a
MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d) RETURN a,m,d LIMIT 10
so you could do similar such that your original statement is changed to
CREATE (a)
CREATE (b)
CREATE (a)-[:KNOWS]->(b) with a.b
MATCH (a)-[:KNOWS]-(b) RETURN a,b
note hopefully this is just an example but generally speaking when creating nodes you should include a label, for example create (a:Person) .....
so that subsequent queries can reference :Person
nodes rather than all nodes
03-29-2020 01:51 PM
Thanks Dana, That is a useful workaround. Not sure if it would work for all my scenarios, but i will use it where i can. Cees
All the sessions of the conference are now available online