How to solve error messsage about neo4j :Cannot use periodic commit in a non-updating query

529 Views Asked by At

I try to execute this comnands, but screen show the message: How to solve this problems?

 Cannot use periodic commit in a non-updating query (line 1, column 7 (offset: 6))
"USING PERIODIC COMMIT 500"

initial input comnand:

 :auto USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM "https://lovecandyhsu.neocities.org/relations.csv" AS csvLine
MATCH (s1:Station { id: toInteger(csvLine.fromId)}),(r:Route { id: toInteger(csvLine.route_informationId)}),(s2:Station { id: toInteger(csvLine.toId)})
OPTIONAL MATCH (s1)<-[:FROM]->(r)
OPTIONAL MATCH (r)<-[:TO]->(s2)
RETURN csvLine
1

There are 1 best solutions below

0
On BEST ANSWER

You are trying to run a read query(non-updating) with a periodic commit. Use it only when you are running a write (updating) query. i.e. Queries with CREATE or MERGE or SET Clauses.

Since you are only reading from the loaded CSV and your Database and not writing anything to the DB, you can run the same query without the commit part (:auto USING PERIODIC COMMIT 500).