Filter entries by relation field length

Hey everyone, is there a way to filter entries by a field’s length? More specifically a relation field. I don’t think this is possible only by normal filtering, maybe a custom controller approach is required in this case but I have no idea on how to get to it.

Example:

In my collection movie I have an actors field, which is a relation to other collection. I wish to filter the movies that have 2 actors or more

Strapi’s entity-service and query engine don’t have suport for this in teory you can make your own query with getting the db.connection and doing raw sql querys or knex querys