cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

neobolt.exceptions.CypherSyntaxError: Invalid input ':'

Hi all,

I'm new to neo4j, and I've been trying to get acquainted with the python driver. I've managed to create some nodes, and now I would like to update them with a new parameter. Essentially, I'd like to implement the following: https://medium.com/neo4j/5-tips-tricks-for-fast-batched-updates-of-graph-structures-with-neo4j-and-c...

So I've managed to use :param in the browser interface to create a "batch" parameter, but when I try to run it using the neo4j python driver, I get the following:

import neo4j
uri = "bolt://xxx.xxx.xxx.xxx:7687"
driver = neo4j.GraphDatabase.driver(uri)
session = driver.session()
batch_statement = ':param {batch: [{name:"Alice",age:32},{name:"Bob",age:42}]}'
set_batch = session.run(batch_statement)

neobolt.exceptions.CypherSyntaxError: Invalid input ':': expected <init> (line 1, column 1 (offset: 0))
":param {batch: [{name:"Alice",age:32},{name:"Bob",age:42}]}"

Does anyone know what may be happening here? I think I'm failing to understand exactly what session.run() does...

1 REPLY 1

You pass params to the driver in the session.run(statement, params)

see the api docs of the python driver: https://neo4j.com/docs/api/python-driver/current/index.html#quick-example

The syntax you use is for Neo4j browser or cypher-shell.