title: How to Create a custom objectID in mongodb
body: <p>As far as i know, you can call ObjectId("something"); to generate a new id.</p>
  
  <p>Is it possible to generate a random id, which does not already exist in the database/collection and has a specific format?</p>
  
  <p>In my case, i want object id to generate a unique random 10digit number.</p>
  
  <p>So the result should be:</p>
  
  <pre><code>var ObjectId = require('mongodb').ObjectID
  var id = new ObjectId("something");
  console.log(id) ==&gt; 0123456789   
  </code></pre>