def addArrowToDatabase(self, arrow):
cql = "MATCH (s),(t)\n" \
"WHERE id(s)={srcid} AND id(t)={tarid}\n" \
"CREATE (s)-[r:snake {name:name}]->(t)\n" \
"RETURN id(r)"
try:
self.connectToDatabase()
with self.dbDriver.session() as session:
id = session.run(cql, parameters={
'snake': arrow.snake_case_def(),
'name' : arrow.name(),
'srcid': arrow.sourceNode().databaseID(),
'tarid': arrow.targetNode().databaseID(),
}).single().value()
arrow.setDatabaseID(id)
except Exception as e:
Error(str(e)).exec_()
if __debug__:
raise ef __debug__:
> raise e
My cypher query is put together in python. Using braces {..} inside of [...] is not working so how would one specify parameters inside of [...]?