Simple question on how to return aggregations

Neo4j Community server 4.3.3 on Ubuntu 20.04

A have a question I wasn't able to resolve:

Imagine to have a query like this:

MATCH (a:A)-[:REL]->(b:B)
     WHERE b.uuid in ['u1','u2',...,'un']

RETURN a,b   ORDER BY b.uuid

Well, the question is:

How is possible to return an array, where each element contains all the occurrences of a and b with the same b.uuid?

Hey there,

It looks like you're looking for the COLLECT() function to create an aggregated list.

Although I'm not sure what you are intending the final list to contain. Could you provide an example of what you're trying to return?

1 Like

TY - Sometimes, as in this case, I feel a little bit stupid ;-)