2

How can I choose which properties to be collected in a Cypher COLLECT statement?

I can do COLLECT([profile.name, profile.email]) but then I don't get the properties names.

Say I have ProfileA which is connected to several ProfileB's, I'd like to have returned ProfileA and a collection of ProfileB's where ProfileA-->ProfileB, but only ProfileB.name and ProfileB.email.

4

1 回答 1

4

目前不支持集合中的文字映射,因此我们无法构建映射集合,这听起来像是您希望能够做到的。

您将集合传递给 collect 的想法应该可行,并且您将获得一个集合集合,其中名称始终位于第一个,电子邮件始终位于最后。

另一种选择是做collect(profile.name) as names, collect(profile.email) as emails两个集合。

或者,您可以只拥有完整的节点。抱歉,没有更好的方法(AFAIK)!

于 2013-03-04T23:36:39.890 回答