Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-15-2021 09:31 AM
Hi
Im trying to create a new node and i want to create a property with a list of values from a variable
tx.run('''
MATCH (n:name {surname: $surname})
SET n.cars = $cars
RETURN n
''', surname='javi', cars = ['car1','car2','car3'])
Im having this error
neo4j.exceptions.ClientError: {code: Neo.ClientError.Statement.ParameterMissing} {message: Expected parameter(s): cars}
Any idea how can initialise a property with an array?
Thanks
Solved! Go to Solution.
04-15-2021 09:49 AM
Hello @javi.xeneize
Your query should work, it works for me, the error means that the query can't find the parameter cars
.
Which version of Neo4j are you using and are you using the same version for the Python driver?
Regards,
Cobra
04-15-2021 09:49 AM
Hello @javi.xeneize
Your query should work, it works for me, the error means that the query can't find the parameter cars
.
Which version of Neo4j are you using and are you using the same version for the Python driver?
Regards,
Cobra
04-15-2021 10:34 AM
Hi
Yes, my understanding was that $cars refers to a string so for a list it would need something different. I will give it another try
Thanks
04-15-2021 10:36 AM
It's possible to store list in Neo4j but all values must have the same type: list of strings, list of integers, list of floats, etc.
04-15-2021 10:41 AM
List of dictionaries/maps?
04-15-2021 10:50 AM
You can have a look at the doc here to get all possible types. It's not possible to get list of maps or dictionnaries.
All the sessions of the conference are now available online