我在Neo4J数据库中有一些带有数组属性的节点。类似的东西:
Node (name = firstNode, array = [fist, second])
Node (name = secondNode, array = [second, third])
我希望写入查询返回此组合:
name = firstNode, arrayItem = first
name = firstNode, arrayItem = second
name = secondNode, arrayItem = second
Name = secondNode, arrayItem = third
有人有什么建议吗?
答案 0 :(得分:1)
UNWIND
用于将数组拆分为多行:
match (n:MyLabel)
unwind n.array as ele
return n.name, ele
(这假设您的节点有MyLabel
标签。)