title: Match $and based on array of filter items in MongoDB
body: <p>I have a Collection in MongoDB of <code>CatalogItems</code>. Every <code>CatalogItem</code> contains a <code>product</code> that has an array of <code>metafields</code>.</p>
  
  <p>In these metafields there are 2 fields that are <code>Brand_ID</code> and <code>Article_No</code></p>
  
  <p>Example CatalogItem document:</p>
  
  <pre><code>CatalogItem = {
      product: {
        metafields: [
          {
            key: "Brand_ID",
            value: "317"
          },
          {
            key: "Article_No",
            value: "48630"
          }
        ]
      }
    }
  </code></pre>
  
  <p>I have an array of filters that is used to match the CatalogItems documents based on these metafields</p>
  
  <p>filter array</p>
  
  <pre><code>filter = [
      { brandId: '317', articleId: '48630' },
      { brandId: '257', articleId: 'ZSA04036' }
    ]
  </code></pre>
  
  <p>I want to return all CatalogItems that match any of the exact combinations in filter. 
  For example to return the stated CatalogItem I currently use this query</p>
  
  <pre><code>// Checks for { brandId: '317', articleId: '48630' }
  query = {
      $and: [
        { "product.metafields": { $elemMatch: { key: "Brand_ID", value: filter[0].brandId } } },
        { "product.metafields": { $elemMatch: { key: "Article_No", value: filter[0].articleId } } },
      ]
    }
  </code></pre>
  
  <p>The issue that I have is that in order for me to look trough all the filter items I have to increment the filter index and rerunning the query. </p>
  
  <p>For example looking for the second filter index I would have to change
  <code>filter[0].brandId</code> to <code>filter[1].brandId</code></p>
  
  <p>Is there a way in Mongo to query using a predefined array of objects instead of rerunning the query multiple times?</p>