0

I'm returning some data on Cypher and I want to label the column 'a/an', but 'RETURN x.name AS a/an' doesn't work, I'm assuming because I need to escape the forward slash. I've tried escaping it by adding one or two backslashes before it, and by using double and single quotes and brackets, but nothing seems to work.

The Neo4j manual has an example using \/ but this didn't work for me.(http://neo4j.com/docs/developer-manual/current/cypher/clauses/where/#query-where-patterns - see 'Escaping in regular expressions')

Likewise the quote marks suggestions in this stackoverflow answer don't seem to work. (Neo4j how to handle special characters like ” \ in Cypher statements)

Any tips would be great! I'm pretty new to Cypher and programming in general so forgive me if I'm just doing something stupid!

I'm using neo4j community edition 3.1.2

Thanks!!

Community
  • 1
  • 1
sally2000
  • 788
  • 4
  • 14

1 Answers1

1

Neo4j escape character is backtick.So in your case you would use:

RETURN x.name AS `a/an`

Tried it and it works.

Hope this helps

Tomaž Bratanič
  • 6,319
  • 2
  • 18
  • 31