title: Spring Boot JPA count query By Multiple Fields
body: <p>Here down my code:</p>
  <pre><code>long contentCount = studentRepository.countBySubjectIdAndStudentTypeAndDepartmentIdIn(subjectId, studentType, departmentIds);
  </code></pre>
  <p><strong>Repository</strong></p>
  <pre><code>public interface StudentRepository extends MongoRepository&lt;Student, String&gt; {
        long countBySubjectIdAndStudentTypeAndDepartmentIdIn(String subjectId, String studentType, List&lt;String&gt; departmentIds);  
  }
  </code></pre>
  <p>Here I have 8 records for subjectId I Passed and 8 records for studentType Passed here. But there are only 3 records for departmentIds I passed. But here this query returns 8 instead of 3.</p>