Hi there, I'm currently trying to run a multi-line query through an apoc's iterate function (targetting 70M nodes hence the need).
I encounter a weird situation when trying to launch the query from the browser, it seems that the multi-line induces a bad interpretation of the script.
Here is the code I'm trying to run, and below that is the rendering of the browser :
CALL apoc.periodic.iterate(
"MATCH (p:RABBIT)",
"SET p.mail = REDUCE(s = '', c IN split(p.mail,'') |
s + CASE c
WHEN '-' THEN '@'
ELSE c
END
)", {batchSize:100, iterateList:true, parallel:true})
The upcomming error, if one needed to see it ... No surprise in it since the parenthesis is not well interpreted.
Yes I have seen this before. You can have a multi-line cypher but you cannot have a multi-line string value unless you use + to concatenate them. Here's an example:
Alright kinda disapointing, even more since I actually have more than 20 lines of conditions in my CASE querystring. But thanks for the reply
I hope this little issue gets fixed in the future.
EDIT: Reason found ! It was actually a mistake on my side in the 1st inner argument of the apoc function, I forgot to RETURN the variable p onto wich works the 2nd argument.
CONCLUSION : There is indeed a graphic bug, but it doesn't affect the overall query processing !
Anyone know if there is an update on this? Hoping that a solution like "start the query with three double quotes and end the query with three double quotes" (or something similar to that) might eventually get implemented to allow for breaking the query into multiple lines, so that you don't have to use a plus sign to concatenate them (and add a space where necessary to some of the lines).
CALL apoc.periodic.iterate(
"MATCH (p:RABBIT)", // <-- not the right query structure
"SET p.mail = REDUCE(s = '', c IN split(p.mail,'') |
s + CASE c
WHEN '-' THEN '@'
ELSE c
END
)", {batchSize:100, iterateList:true, parallel:true})