title: How can I build an $or query for MongoDB using the Java driver?
body: <p>I'm trying to Or some conditions in MongoDB (using the Java driver). This is what I'm doing : </p>
  
  <pre><code>Pattern regex = Pattern.compile("title");   
  DBCollection coll = MongoDBUtil.getDB().getCollection("post_details");
  
  BasicDBObject query = new BasicDBObject();
  query.put("category_title", "myCategory");      
  query.append("post_title", regex);  
  query.append("post_description", regex);    
  
  DBCursor cur = coll.find(query);
  while(cur.hasNext()) {
      System.out.println(cur.next().get("post_id"));
  }
  </code></pre>
  
  <p>I'd like to use the <code>$or</code> operand on these conditions, but I guess the default is "and" and I don't know how to change it. In the above code if one of the conditions returns <code>null</code>, the result will be <code>null</code> too.</p>