neo4j-contrib/neo4j_doc_manager

Ensure character translation for valid node/property names/etc

Closed this issue · 4 comments

Looks like dashes are valid for mongo document collection names, but invalid for Neo4j?

InvalidSyntax: Invalid input '-': expected an identifier character, whitespace or ')' (line 1, column 33 (offset: 32))
"CREATE CONSTRAINT ON (d:employee-territories) ASSERT d._id IS UNIQUE"

Source: tried running mongo-import.sh from:
https://github.com/tmcnab/northwind-mongo

jexp commented

We have to use backticks around all identifiers that we don't control

like

CREATE CONSTRAINT ON (d:`employee-territories`) ASSERT d._id IS UNIQUE

same goes for property names etc.

Right now, she's doing parameter substitution. Shouldn't py2neo and/or the Neo4j protocol automatically handle this?

jexp commented

No parametrization for identifiers in neither.

PR #40 fixes this point. Let me know if you have any further considerations. Thanks.