title: Spring MongoTemplate - find by regex in collection
body: <p>Saying i have a multivalue field in a mongo document:</p>
  
  <pre><code>public class MongoEntity{
      private List&lt;String&gt; field;
  }
  </code></pre>
  
  <p>What would be the correct <a href="http://docs.spring.io/spring-data/mongodb/docs/current/api/org/springframework/data/mongodb/core/query/Criteria.html" rel="nofollow">criteria</a> for querying a regex in that field?</p>
  
  <p>I've tried</p>
  
  <pre><code>Criteria.where(searchText).regex(searchText).in("field");
  </code></pre>
  
  <p>But that results in</p>
  
  <pre><code>org.springframework.data.mongodb.UncategorizedMongoDbException: 
  Can't canonicalize query: BadValue unknown top level operator: $in; 
  nested exception is com.mongodb.MongoException: Can't canonicalize query: BadValue unknown top level operator: $in
  </code></pre>