title: MongoTemplate Criteria Query
body: <p>I'm generating a complicated <code>Mongo</code> query depending on multiple parameters. One of criterion that I want to make with <code>Criteria</code> helper class is:</p>
  
  <pre><code>{"field1": {$exists: true, $ne: false}}
  </code></pre>
  
  <p>I tried to make it with:</p>
  
  <pre><code>Criteria.where("field1").is(Criteria.where("$ne").is(false).and("$exists").is(true))
  </code></pre>
  
  <p>But it generates:</p>
  
  <pre><code>{ "field1" : { $java : org.springframework.data.mongodb.core.query.Criteria@23864e60 } 
  </code></pre>
  
  <p>So, <strong>how to achieve the exact query that i need?</strong>
  I can't hardcode that query string, because these type criterions are generated dynamically for field1,...fieldN and then combined with <code>$or</code>:</p>
  
  <pre><code>statusCriteria = statusCriteria.orOperator(criterias.toArray(new Criteria[criterias.size()]));
  </code></pre>