title: how to do a regex query on mongodb ObjectId field
body: <p>this is a bit tricky.. how do you do a regex query on the ObjectId field?</p>
  
  <p>i'm using the java api, so this is what i have so far</p>
  
  <pre><code>BasicDBObject q = new BasicDBObject()
  q.put(field, Pattern.compile(value, Pattern.CASE_INSENSITIVE));
  </code></pre>
  
  <p>this works fine for any regular field. but doesn't seem to work with ObjectId field. which i assume is because i can't compare an ObjectId to a string? and i can't exactly just put a partial id or a regex into a new ObjectId. it'll just throw an error. </p>
  
  <p>any ideas on this? i'm trying to give users a way to enter part of an id, and be able to get back all documents with that pattern. </p>
  
  <p>thanks in advance!</p>