Function collect() arranges each row of an alias into a list (ignoring the rows that are null), in their original order, and returns this list. Only one row from the alias will be kept after this function is called, and all the rest rows will be abandoned.
Arguments:
Returns:
Sample graph: (to be used for the following examples)

Example: Return the list of age of all nodes in the graph
UQLfind().nodes() as n return collect(n.age)
Result[53,27,20,27,25]
Example: Return the list of nodes of @professor in the graph
UQLfind().nodes({@professor}) as n return collect(n)
Result[ {"id":"P001","uuid":"1","schema":"professor","values":{"age":"53","email":"[email protected]"}}, {"id":"P002","uuid":"2","schema":"professor","values":{"age":"27","email":"[email protected]"}} ]