I have a Neo4j graph containing PI and officer nodes, with relationships between them (each of which has an institution property). I'm trying to create an inst_list property for each PI which lists all the institution properties of all of their edges. I'm still learning my way around Cypher, but confused as to why this is only creating an empty array for each PI:
MATCH (p:pi:DOE)-[a:award]-(o:officer:DOE)
WITH pi, a, COLLECT(distinct a.instituion) as insts
SET pi.inst_list=insts
It seems like it is an issue with COLLECT, as
MATCH (p:pi:DOE)-[a:award]-(o:officer:DOE)
WITH a.institution AS insts
RETURN insts
returns all the expected values.