Create node with a list as a property


Im trying to create a new node and i want to create a property with a list of values from a variable'''
      MATCH (n:name {surname: $surname})
      SET = $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?


Hello @javi.xeneize :slight_smile:

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?



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


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.

List of dictionaries/maps?

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.

1 Like