In Scala, I'm trying to filter a map based on a unique property with the Map values.
case class Product(
item: Item,
)
productModels: Map[Int, Product]
How can I create a new Map
(or filter productModels
) to only contain values where Product.Item.someproperty
is unique within the Map
?
I've been trying foldLeft
on productModels, but can't seem to get it. I'll keep trying but want to check with you all as well.
Thanks