Aggregate on fields and get distinct documents