Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-14-2022 12:19 PM - edited 06-14-2022 12:20 PM
Greetings!
I am working on creating a relationship between 2 existing node programmatically using Python. While the nodes have been created, the query of creating the relationship is getting executed as code, but I am not able to visually see the relationship between the 2 nodes - such a relationship isn't even recognized in the Neo4j Browser.
Solved! Go to Solution.
06-14-2022 01:10 PM
Hi @saadiiii
If the argument crime_id is passed as a String, a toInteger() statement is required.
From $crime_id to toInteger($crime_id)
query = 'MATCH (c:Crime), (j:Junction) WHERE c.crime_id = toInteger($crime_id) AND j.id = $junction_id CREATE (c)-[r:NEAREST_CRIME_JN {distance: $distance, crime_id: $crime_id, junction_id: $junction_id}]->(j) return type(r)'
https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tointeger
06-14-2022 01:10 PM
Hi @saadiiii
If the argument crime_id is passed as a String, a toInteger() statement is required.
From $crime_id to toInteger($crime_id)
query = 'MATCH (c:Crime), (j:Junction) WHERE c.crime_id = toInteger($crime_id) AND j.id = $junction_id CREATE (c)-[r:NEAREST_CRIME_JN {distance: $distance, crime_id: $crime_id, junction_id: $junction_id}]->(j) return type(r)'
https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tointeger
All the sessions of the conference are now available online