I have a form that is set up to include multiple values with checkboxes. I pass all those values into an array 

```
{% set specsQuery = craft.request.getParam('specs') %}
{% set productSpecsCategory = craft.categories.group('productSpecs').slug(specsQuery) %}

```

My problem is the code below is seeing those values as OR instead of AND. I'm assuming it's because it's all put on the one targetElement line. The amount of criteria a user can select is essentially infinite (as in the max right now is 5 but more categories can be added in craftcms admin area and are created dynamically on the site as more options.

```
{% set entries = craft.commerce.products('footwear').relatedTo('and',
      { targetElement: productSpecsCategory, field: 'productSpecs' }
) %}

```

edit: I have tried

```
{% set entries = craft.commerce.products('footwear').relatedTo(['and',
  { targetElement: productSpecsCategory, field: 'productSpecs' }
]) %}

```

edit: This works with 2 criteria, but no more or less (obviously). Is there a way to loop the targetElement?

```
{% set entries = craft.commerce.products('footwear').relatedTo([ 'and',
  {targetElement: productSpecsCategory[0], field: 'productSpecs'},
  {targetElement: productSpecsCategory[1], field: 'productSpecs'}
]) %}

```