问题
I have a file that contains a long list of Cypher statements, something like:
create (n:oeuvre {ide12:"41",numpers:[87603],titre:"JE PARS"});
create (n:oeuvre {ide12:"151",numpers:[395225,364617,396308,306762],titre:"I DID IT FOR LOVE"});
create (n:oeuvre {ide12:"67",numpers:[54001],titre:"GRAND PERE N AIME PAS LE"});
create (n:oeuvre {ide12:"80",numpers:[58356],titre:"MON HEURE DE SWING"});
create (n:oeuvre {ide12:"91",numpers:[58356],titre:"AU QUATRIEME TOP"});
When I drag my file on the Cypher admin console area "Drop a file to import Cypher or Grass" and then click on the little play icon, I get the message "Expected exactly one statement per query but got: 1405".
Is there a way to batch execute Cypher requests via the admin console? The wording "Drop a file to import Cypher" seems to suggest so.
Thanks
Yann
回答1:
Yeah, the console just let's you run one statement at a time. Fortunately a statement can have multiple CREATE
clauses, so if you just remove the semi-colon characters it should work.
Alternatively you can use the neo4j-shell
command with the -file
argument to run a cypher script file. This method allows for scripts with multiple commands separated by semi-colons.
来源:https://stackoverflow.com/questions/29628204/trying-to-execute-a-list-of-cypher-statements-in-neo4j-via-the-admin-interface