Neo4J减少了地图

时间:2014-07-31 15:02:37

标签: neo4j cypher reduce reduction

是否可以在Cypher查询中减少Map中的Collection?

例如:

MATCH (n) WHERE n.foo =~ "ba[rz]" 
RETURN reduce({}, barz IN collect(n.foo) | {`(barz)`:[n]} )

输入:

[
    {foo: 'bar'},
    {foo: 'baz', some: 'thing'},
    {foo: 'baz', or: 'other'}
]

输出:

{
    bar: [
        {foo: 'bar'}
    ],
    baz: [
        {foo: 'baz', some: 'thing'},
        {foo: 'baz', or: 'other'}
    ]
}

0 个答案:

没有答案