title: Convert string to ObjectID in MongoDB
body: <p>I am developing an API using Codeigniter and MongoDB.
  In some parts of the database I have saved the ID of an image in ObjectID format
  instead of a string. Now I got an ID in string format and I need to query the database using it.</p>
  <p>How can I &quot;convert&quot; a string to an ObjectID so that I can do the query?</p>
  <p>From this:</p>
  <pre><code>34234234234234234234
  </code></pre>
  <p>To this:</p>
  <pre><code>ObjectID(&quot;34234234234234234234&quot;)
  </code></pre>