Here’s a way to group your collection data via exact attribute values using BackboneJS and UnderscoreJS.
this.categories = _.groupBy(this.collection.models, function(row) { return row.attributes.{attribute you want to group by}; }); |
this.categories should be a new object with your data grouped by the attribute you selected.
The tricky part was returning back the attributes of each model by going row.attributes.