Drop index with on nested property (with a dot) in Neo4j

Davide Source

I'm using Neo4j with Bolt and the Neo4j driver in Java. When I tried to run the following command:

DROP INDEX ON :SingleBoardComputer(id.id)

Note that the name of the property is actually "id.id" (basically with a dot).

I have the following error:

Neo.ClientError.Statement.SyntaxError: Invalid input '\': expected whitespace or a list of property key names (line 1, column 36 (offset: 35))
"DROP INDEX ON :SingleBoardComputer(id.id)"

Is there any way to drop an index using the driver?

I'm using Neo4j 3.3.5 and the neo4j driver 1.6.1

I'm surprised because I can create the index without problems.




answered 3 months ago Davide #1

The solution is to escape the field:

DROP INDEX ON :SingleBoardComputer(`id.id`)

comments powered by Disqus