How to filter array of objects and get distinct based on a specific property

join shbcf.ru