When running Cypher queries it is important to ensure that you are quoting correctly when using a mixture of single and double quotes. Failure to do so will lead to an error like the following:
Invalid input 'i': expected 't/T' or 'e/E' (line 1, column 62 (offset: 61)) "match (n:Node) where n.text = 'This is an example of using 'single quotes' incorrectly' return n"
In the examples that follow the first two lines will return expected results. The last line, however, will yield the error above.
match (n:Node) where n.text = "This isn't an example of a problem quote" return n
match (n:Node) where n.text = 'This is an example of using "double quotes" correctly' return n
match (n:Node) where n.text = 'This is an example of using 'single quotes' incorrectly' return n
The following quoting rules apply when using Cypher:
- Double quotes can contain one or more single quotes.
- Single quotes can contain one or more double quotes.
- Single quotes cannot contain single quotes.
Comments
0 comments
Article is closed for comments.