Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-02-2019 03:16 PM
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 [...]?
03-03-2019 03:32 AM
You can use $name which is the newer syntax of parameters
also the "[r:snake {name:{name}}]"
not working will rather be a python issue than a Cypher one.
03-03-2019 07:31 PM
Thanks, Michael. I think the code (with your corrections) works now or am about to test it.
All the sessions of the conference are now available online