title: Create a 'contains' query using Java and MongoDB
body: <p>I'm trying to follow this <a href="https://stackoverflow.com/questions/10610131/checking-if-a-field-contains-a-string#10616781">post</a> to create a "contains" query in Java. The problem is it's giving me an error.</p>
  
  <p>At the moment i have the following code: </p>
  
  <pre><code>MongoClient mongoClient = null;
  DBCursor cursor = null;
  
  mongoClient = new MongoClient( "localhost" , 27017 );
  DB db = mongoClient.getDB("bd-films");
  DBCollection coll = db.getCollection("films");
  
  DBObject query = new BasicDBObject({"title" : {$regex : "name"}});         
  cursor = coll.find(query);
  </code></pre>
  
  <p>The error it gives me is in the 'query' line:</p>
  
  <pre><code>Syntax error on token ""title"", invalid Label
  Syntax error, insert ";" to complete Statement
  Syntax error on token ")", delete this token
  </code></pre>
  
  <p>I use the cursor for inserting it into a JTable.<br>
  Driver: mongo-java-driver-3.4.2<br>
  Thanks in advance.</p>