group-by
Group By​
The groupBy
function returns the entries of a model grouped by a specific attribute
. The groupBy function returns the entries of a model grouped by a specified attribute. This feature may enhances the clarity of your application's content by organizing related entries together for easier visualization.
const yearQuery = dcupl.query.generate('Style', {
attribute: 'year',
operator: 'eq',
value: 2012,
});
const groupedBySeason_filteredByYear2012 = dcupl.fn.groupBy({
modelKey: 'Style',
options: {
attribute: 'season',
},
query: yearQuery,
});
info
Try it out yourself in the Playground