All queries that potentially return more than one record using Quick are returned using a QuickCollection
. QuickCollection
is a specialized version of CFCollection
. It is a component that smooths over the various CFML engines to provide an extendible, reliable array wrapper with functional programming methods. You may be familiar with methods like map
(ArrayMap
), filter
(ArrayFilter
), or reduce
(ArrayReduce
). These methods work in every CFML engine with CFCollection
.
Collections are more powerful than plain arrays. There are many methods that can make your work easier. For instance, let's say you needed to group each active user by the first letter of their username in a list.
So powerful! We think you'll love it.
Additionally, QuickCollection
includes a load
method. load
lets you eager load a relationship after executing the initial query.
This is the same as if you had initially executed:
QuickCollection
includes a $renderData
method that lets you return a QuickCollection
directly from your handler and translates the results and the entities within to a serialized version. Check out more about it in the Serialization chapter.