Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-21-2021 08:01 AM
I am trying to create a relation at the same time I create a node. I am using javascript neo4j driver.
When I run the query in neo4j desktop it works but not when using the driver.
session.run(`
match (a:Node1) where a.name = "Jon Doe"
create (b:Node2)<-[r:Reln]-(a)
set b.name = ${args.name}
return a,b,r
`)
Solved! Go to Solution.
01-23-2021 05:35 AM
Hi,
can you try to use proper parameters in your cypher like $name
and pass them as a map ot the driver?
(same for your literal "Jon Doe"
value.)
please also share the full error message that should contain the query that Cypher sees.
I guess i your case you would have needed to use "${args.name}"
so that there are quotes around your string.
01-23-2021 05:35 AM
Hi,
can you try to use proper parameters in your cypher like $name
and pass them as a map ot the driver?
(same for your literal "Jon Doe"
value.)
please also share the full error message that should contain the query that Cypher sees.
I guess i your case you would have needed to use "${args.name}"
so that there are quotes around your string.
01-23-2021 07:47 AM
Thank you very much.. such a silly mistake from my part...
All the sessions of the conference are now available online