title: Spring Data MongoDB criteria with $in and list of regexes
body: <p>I've spotted MongoDb functionality that allows to find elements by a list of regexes using $in. Example:</p>
  
  <pre><code>db.inventory.find( { tags: { $in: [ /^be/, /^st/ ] } } )
  </code></pre>
  
  <p>And it works perfectly when typed directly to some Mongo tool as a query.</p>
  
  <p>Now I'm trying to apply this query using spring-data-mongodb version 1.8.4.RELEASE. Example code:</p>
  
  <pre><code>List&lt;Pattern&gt; regexList = Arrays.asList(Pattern.compile("\\b5\\b"), Pattern.compile("\\b8\\b")); //regexes to find numbers 5 or 8 in string
  Query query = new Query();
  query.addCriteria(Criteria.where("key").in(regexList));
  </code></pre>
  
  <p>And it does not find anything, because query looks like this:</p>
  
  <pre><code>{"key" : { "$in" : [ { "$regex" : "\\b5\\b"} , { "$regex" : "\\b8\\b"}]}}}
  </code></pre>
  
  <p>First problem is the "$regex" that is not allowed in "$in" queries. Second problem is quotation marks that envelops regexes. I've also tried passing string list, but with no success either. </p>
  
  <p>Am I missing something? </p>