Inserting a Python Dictionary Inside a Node

I'm trying to put a Python dictionary inside of nodes, because I recieve data as a dictionary in Python and need to save it in Neo4j.

My query looks like this: "create (a {name:"node", text: "", values: {color: "red", size: "7 m"}}) "
and it gives me this error: "Neo.ClientError.Statement.TypeError
Property values can only be of primitive types or arrays thereof. Encountered: Map{color -> String("red"), size -> String("7 m")}."

I don't understand this because in the manual section Neo4j Cypher Manual / Syntax / Maps dictionaries get referred to as maps and are used just like i do in the above query.

How to solve this error?

Hello @m.h98 :slight_smile:

You cannot store a map as a property but you can use a map to set several properties. I don't know if it's clear? In your case, you are doing both so you can solve your issue by removing the depth from your map:

CREATE (a {name:"node", text: "", color: "red", size: "7 m"})

The only composite object that you can store is a list of homogeneous type such as a list of integers.

Regards,
Cobra