简体   繁体   中英

How to load lists of lists as string in neo4j using py2neo

I have sample param_list-

param_list = [{
    "labels" : ["test"],
    "properties" : {"some_list" : "[['sample', 'testing']]"}
}]

and have cypher templates-

cypher_template = """UNWIND $batch as row
CALL apoc.create.node(row.labels, row.properties) yield node
RETURN count(*)"""
result = graph.run(cypher_template, {"batch" : cypher_list})

for i in result:
    print (i)

when i run the cypher statement i get the following error:

py2neo.database.ClientError: ProcedureCallFailed: Failed to invoke procedure `apoc.create.node`: Caused by: java.lang.IllegalArgumentException: [[Ljava.util.ArrayList;@125e2edb:[Ljava.util.ArrayList;] is not a supported property value

Even though i have values of properties as string type, i still get this error saying lists of lists is not supported.

py2neo == 4.3.0 neo4j == 4.0.0

Neo4j does not support a property value that is a list of lists.

Try changing [['sample', 'testing']] to ['sample', 'testing'] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM