简体   繁体   English

如何使用 py2neo 在 neo4j 中将列表列表加载为字符串

[英]How to load lists of lists as string in neo4j using py2neo

I have sample param_list-我有示例 param_list-

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

and have cypher templates-并拥有 cypher 模板-

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:当我运行 cypher 语句时,我收到以下错误:

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 py2neo == 4.3.0 neo4j == 4.0.0

Neo4j does not support a property value that is a list of lists. Neo4j 不支持作为列表列表的属性值。

Try changing [['sample', 'testing']] to ['sample', 'testing'] .尝试将[['sample', 'testing']]更改为['sample', 'testing']

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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