have a graph that contains nodes and relationships like what I draw in the picture, I want a collection of all cS nodes, but my CQL only returns one per line in text view, how can I get the result I need? ( I need something like [firstCS, secondCS, thirdCS])
MATCH (rD:d)-[:IHF]->(rK)-[:HC]->(cS:c)
WITH rD, cS
WITH rD, cS, SIZE( ()-[:HC]->(cS) ) AS Csum
RETURN rD.name, cS.name, Csum
your cypher describes a relation of [:HS] but yet your picture appears to have a relationship of :HC
the usage if SIZE( ()-[:HS]->(cS) ) will report the number of :HS relationships from a given cS aliased node to any other node and from the picture :cS labeled nodes appear to have only 1 relationship.
in the initial match is (rk), which basically says match a :d labeled not via a :IHF relationship to any other node (regardless of label). Should this instead be (rk:RK) or similar