How to filter a checkBox group database field based on a checkBox group user input?

My website is a tutoring website and my tutors select their subjects via a checkbox group, their choices are then stored in a database. See the figure below to see how their data is collected.


I then have a dynamic page with a repeater that shows a preview profile for each of my tutors. I want to filter that repeater/dataset by the same input seen above. So that a client can come on and select what subjects they would like and the repeater will filter accordingly. The image below is how my database is set up.

Notice it is categorised by subject. I have tried a lot of different methods, but have run into a lot of issues when trying to compare two arrays to each other inside a filter. What I have currently can be seen below, I am only trying to filter by one subject currently, but it is just filtering everything out.

  1. import wixData from “wix-data”;

  2. export function math_change(event){

  3. console.log(event[“target”][“id”])

  4. let subject = event[“target”][“id”];

  5. let values = event[“target”][“value”];

  6. console.log(values)

  7. filter(subject,values)

  8. //let chosen = $w()

  9. }

  10. function filter(subject, values){

  11. var qry = wixData.query(“Team”) // initialise query

  12. $w(’ #teamDataset ').setFilter(

  13. wixData.filter()

  14. .hasSome(subject, values)

  15. )

  16. . catch ((err) => {

  17. console.log("error: " + err)

  18. })

Sorry it is not formatted properly I tried to paste it into a code snippet but it put it in the above form. Any help would be greatly appreciated and I am open to different ways to approach it I just thought this was a very user-friendly approach, cheers.