Re: Quick question on Cypher

瀏覽次數:13 次
跳到第一則未讀訊息

Michael Hunger

未讀,
2017年5月5日 上午10:04:452017/5/5
收件者:Bastien Vigneron、ne...@googlegroups.com、Andrew Bowman
a list of lists

MATCH (p)-->(c)
WITH p, collect(c) as children
RETURN collect([p, children])

or a list of maps

MATCH (p)-->(c)
WITH p, collect(c) as children
RETURN collect({parent:p, children:children})

or with pattern comprehensions


MATCH (p)
RETURN collect( [ (p)-->(c) | {parent:p, children:children} ] )

Cheers, Michael

Andrew perhaps sth for the KB ?

Am 04.05.2017 um 18:35 schrieb Bastien Vigneron <bas...@libertymedical.fr>:

Hello Mickael,

I hope you're well.
I would like to get a list of list of nodes via something like « RETURN COLLECT(p, COLLECT(c)) », I’ve tried many things and searching on Neo4j official documentation but without success.

I put a small screenshot of subgraph concerned :

<Capture d’écran 2017-05-04 à 18.28.03.png>

We need to get the Mission (blue) node with all Period (green) nodes in a list and for each Period node a list of People (yellow) that have accepted the concerned Period.

Did you know if they have a way to do that ?



Bastien Vigneron
Chief Technology Officer

<lm_logo.png>


回覆所有人
回覆作者
轉寄
0 則新訊息