title: How to check that value equals at least one field from list?
body: <p>I have method like this:</p>
  
  <pre><code>for (String fieldName : fieldArray) {
          Query query = new Query();
          query.addCriteria(Criteria.where("data." + fieldName).is("some_constant"));
          if (mongoTemplate.find(query, DataPoint.class).size() &gt; 0) {
              return true;
        }
  }
  return false;
  </code></pre>
  
  <p>This code looks inefficient because it access to db so much how fieldArray size.</p>
  
  <p>Is there way to replace it using single query?</p>