【neo4j】【py2neo】【relationship】【TypeError】

带关系的属性数据入库

node1 = Node("road_id", node_id = node_id_1, lng = lng1, lat = lat1)
node2 = Node('road_id', node_id = node_id_2, lng = lng2, lat = lat2)

properties = {'road_id':road_id, 'length':length}

rltns = Relationship(node1,'leadTo',node2,**properties)

这里需要注意road_id和length的数据类型问题,建议使用python基本的数据类型

当时的报错信息如下:

raise TypeError("Neo4j does not support JSON parameters of type %s" % type(data).__name__)

原因是road_id, length 使用的是numpy.int64 和numpy.float64

原文地址:https://www.cnblogs.com/ddzhen/p/14024196.html