Compare json data, search

I get all elements per json, have two groups in my backend where i set proporties, for example: Color: Green and Form: Rounded. The search form look also so, Color: Green, Yellow, Blue and Form: Rounded, 4-Square, 6-Square.

My Json output look so:


With Post request i get all my selected boxes and i see id’s, id data is also from json.
I don’t know, how can i now compare this data and give true result? This is “or” search with more options.