Sometimes, you are writing a Cypher statement and find out you have to write a nested Cypher statement. Here is an example:
CALL apoc.cypher.run(
"CALL apoc.cypher.run(
'CALL apoc.cypher.run(
\"CALL apoc.cypher.run(
\\'RETURN true\\', {}) YIELD value RETURN value
\", {}) YIELD value RETURN value
', {}) YIELD value RETURN value
", {}) YIELD value RETURN value
Remember, that the better way is to try to assemble the strings you need ahead of their execution, especially if the strings can include the parameters you want. You can even use this to do recursion if you're passing in a list for processing, with each element of the list being a Cypher string for execution. This exchanges the complexity of dealing with nested quotes and escape slashes with the construction of a semi-recursive query string.
Comments
0 comments
Please sign in to leave a comment.