select

Hi, I'm trying to query all the products and their respective categories. I have a big problem, I've managed to filter as I expect, however the result has a strange format for me. If a product has 3 categories the result creates 3 identical objects with only 1 key difference and I want it to only create one object and not repeat for each category, I know that groupBy helps me, but it makes me lose information. Is there an easy way to approach this case? I've thought about doing the queries separately and adjusting everything at the end or iterating over the result and formatting it to my liking, but it's getting a bit cumbersome.
image.png
Was this page helpful?