Array distinct. Select distinct. mongodb distinct. select distinct on (name), id, name from table_a. sing up with mongodb.