14

I realized only after importing a ton of nodes that I had created relationships called START, which is a reserved keyword. Querying the DB through the Cypher console hence always complains about the reserved keywords:

SyntaxException: reserved keyword "start n=node(0) match n<-[:START]-r return count(r)"

The only workaround that comes to mind is creating new copy relationships with a different name and then deleting the old ones.

Is there an easy way to rename all of these relationships or some way to escape reserved keywords in Cypher?

4

4 に答える 4

5

あなたが正しいです。既存の関係の名前を変更することはできません。すべての関係を実行し、並行して新しい関係を作成し (すべてのプロパティを含む)、古い関係を削除する必要があります。

STARTまた、バッククォートを使用して暗号クエリの予約語を引用し、関係をそのままにしておくことを検討することもできます。

start n=node(0) match n<-[:`START`]-r return count(r)
于 2012-12-11T10:21:22.990 に答える