title: Query list based on input list value
body: <p>I stored data  in mongoDB  in User Collection in below format </p>
  
  <pre><code>{
      "_id" : ObjectId("571ded1a1b8bd2c34aaf3c4a"),
      "_class" : "com.unisys.workbench.domain.User",
      "userName" : "admin",
      "password" : "admin",
      "email" : "xyzq@gmail.com",
      "contact1" : "9889482416",
      "contact2" : "1234567890",
      "roles" : [ 
          {
              "roleName" : "ROLE_ADMIN"
          }
      ]
  }
  </code></pre>
  
  <p>To Restive data based on roleName I written Below Query</p>
  
  <pre><code>List&lt;User&gt; users= mongoTemplate.find(new Query().addCriteria(Criteria.where("roles.$roleName").is(role)),
                      User.class);
  </code></pre>
  
  <p>But its always returning null .</p>
  
  <p>For email below Query is working fine </p>
  
  <pre><code>mongoTemplate.findOne(new Query().addCriteria(Criteria.where("email").is(email)),
                      User.class);
  </code></pre>