I have an object array, products, with properties "categoryid, categoryname, name, price". I want to return an object array with just "categoryid, categoryname" from this but since categoryid exist multiple times, I want only the unique results.
I can get both fields with this code but it won't be unique.
_.map(products, _.partialRight(_.pick, ['categoryid', 'category']))
How can I make this unique?