I need to retrieve a node in Neo4j and I only have the internal ID.
Is there a way to retrieve the node that has the ID in the given set in one cypher query ?
I'm using Neo4j 2.1.5
Thanks !
from neomodel import db
query="MATCH (n:Message) WHERE ID(n)="+id+" SET n.type='"+str(ans)+"', n.reprimands='"+str(ans2)+"'"
db.cypher_query(query)
I tried this but it didn't work out. I asigned the id in the python code, but it didn't seemed to have matched the ID I already had in my neo4j db. I used SET to change some attributes in the db but nothing changed at all.
I am using neomodel to access the DB via python.
I think it's because you have
ID
capitalized.Also, it looks like you're naming the python variable with
id
. That's already a python function, so I'd recommend naming the variable something likedatabaseId
. You code would become...The cypher would look something like this: