How to get distinct values of a field in strapi via REST API

I did a custom controller that overrides the default functionality.
I found nothing else.