Dumas.DED
Dumas.DED

Reputation: 626

Py2neo (V4) - CypherSyntaxError: Variable `$x` not defined

I am trying in the absolute simplest way I can think of to create a node in my neo4j database using py2neo. Here is an example:

from py2neo import Graph, Node

db = Graph()
node = Node('band', name='The Yeah Yeah Yeahs')
db.create(node)

With this (and every variation thereof), I get the following error:

neo4j.exceptions.CypherSyntaxError: Variable `$x` not defined (line 1, column 8 (offset: 7))
"UNWIND $x AS data CREATE (_:band) SET _ = data RETURN id(_)"

I've tried every permutation of this that I can think of and I still can't see anything in my code that might be causing a syntax error. This appears to be some kind of internal mechanism for generating a cypher query in order to create the node, but even with the complete stack trace I haven't been able to track down where this error might be coming from or what might be causing it.

I am using a virtual environment that uses Python 3.7.2 and py2neo 4.1.3.

Any thoughts or insights would be hugely appreciated. Thanks very much in advance.

Upvotes: 1

Views: 465

Answers (1)

Nigel Small
Nigel Small

Reputation: 4495

Which version of Neo4j are you using? The $x replaced the older {x} syntax and the error message implies that $x isn't recognised. If this isn't a recent version, please try upgrading your database and try again.

Upvotes: 1

Related Questions