繁体   English   中英

neo4j密码,收集时返回字段而不是节点

[英]neo4j cypher, return fields instead of nodes when collecting

给定以下查询

match (a)-->(b)-->(c)
where id(a) = 0
return b.name, collect(c) as cs

如何返回仅由几个字段而不是整个节点组成的集合?

一个字段很容易:

match (a)-->(b)-->(c)
where id(a) = 0
return b.name, collect(c.fieldName) as cs

对于多个字段名称,也许将它们串联起来?

match (a)-->(b)-->(c)
where id(a) = 0
return b.name, collect(c.fieldName1 + delimiter + c.fieldName2) as cs
match (a)-->(b)-->(c)
where id(a) = 0
return b.name, collect( { field1: c.field1, field2: c.field2 } ) as cs

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM