I have the following array:
[
{ id: 1, art: "art_123" },
{ id: 2, art: "art_234" },
{ id: 3, art: "art_123" }
]
I need to have the following output:
[
{ art: "art_123", ids: [1,3] }
{ art: "art_234", ids: [2] }
]
I've tried to group by "art" but I can't solve this. How to count total entries from every art?