neo4j查询返回带有集合项的节点

时间:2015-07-22 08:47:35

标签: collections neo4j

我在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

有人有什么建议吗?

1 个答案:

答案 0 :(得分:1)

UNWIND用于将数组拆分为多行:

match (n:MyLabel)
unwind n.array as ele
return n.name, ele

(这假设您的节点有MyLabel标签。)