title: How to select documents by checking array elements in mongodb and spring criteria
body: <p>I have the following document</p>
  
  <pre><code>{ "std_name": "Abcd", "tags": ["tag1", "tag2", "tag3"] },
  { "std_name": "Wxyz", "tags": ["tag4", "tag1", "tag3"] },
  { "std_name": "Demoname", "tags": ["tag4", "tag2", "tag3"] },
  </code></pre>
  
  <p>where i have to select all documents with tag2
  i tried with criteria as follow but returns null</p>
  
  <p>1.<code>Criteria.where("tags").is("tag2")</code></p>
  
  <p>2.<code>Criteria.where("tags").all("tag2")</code></p>
  
  <p>how to get the result.</p>