title: Java equivalent for a MongoDB select query
body: <p>I would like to retrieve the following information:</p>
  
  <pre><code>select names from database where names like 'Jon';
  </code></pre>
  
  <p>but for MongoDB in Java. Essentially, it should return all names that contain the word Jon in them, like Jonathan, Jong etc etc. I know that there is the <code>$in</code> operator in MongoDB, but how do I do the same in Java, using the Java driver? I've been trying to look for it everywhere but am getting nothing. I've tried: <code>query = new BasicDBObject("names", new BasicDBObject("$in", "Jon"));</code>, and <code>query = new BasicDBObject("names", new BasicDBObject("$in", Jon));</code> </p>
  
  <p>But neither of them worked :( Please help!</p>