[英]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.