Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-13-2022 05:22 AM
Hi good morning,
I am developing an application that updates my graph in real-time. I receive an invoice id that I have to update.
In my case, the invoice is a Relationship between two subjects.
I'm working Python development environment.
I can read the Report, but I cannot update it.
the Cypher query working perfectly
MATCH ()-[r:HAS_INVOICE {invoiceId: 40624}]->()
set r.updateField=True;
This is the python code
# tag::updateRelationship[]
def update_relationship(self, memento_invoice):
def upd_relationship(tx, id):
return tx.run(
"MATCH ()-[r:HAS_INVOICE {invoiceId: toInteger($invoice_id)}]->()"
"SET r.alreadyExisted=true;",{"invloice_id": id}
).consume
with self.driver.session() as session:
result = session.write_transaction(upd_relationship, id)
return result
# end::updateRelationship[]
Still receive the following error
data.py", line 340, in fix_parameters
raise TypeError("Parameters of type {} are not supported".format(type(value).__name__))
TypeError: Parameters of type builtin_function_or_method are not supported
Any suggestion or help please
Rinaldo
Solved! Go to Solution.
09-13-2022 10:53 AM - edited 09-13-2022 10:55 AM
@ameyasoft is correct. Don't use quotes around the key in the map. Use this instead, and it was not spelled correctly as well. You don't need to use 'toInteger' if you pass the value in as an integer.
{invoice_id: id}
09-13-2022 10:39 AM
Check this:
{"invloice_id": id}
This must be raising that error.
09-13-2022 10:53 AM - edited 09-13-2022 10:55 AM
@ameyasoft is correct. Don't use quotes around the key in the map. Use this instead, and it was not spelled correctly as well. You don't need to use 'toInteger' if you pass the value in as an integer.
{invoice_id: id}
09-14-2022 02:58 AM
Thank you @ameyasoft and @glilienfield for your reply
your solution it's work fine, another error on my side miss speling
invloice_id
in place of invoice_id
Thank you guys for your help.
Rinaldo
All the sessions of the conference are now available online