title: Using mongoose.Types.ObjectId() with multiple scaled machines (Duplication issue?)
body: <p>Let's just assume the below code will be executed many times when running a live server. If I scaled the machine to have 10 instances for example, is there a small chance the ObjectId will be duplicated when saving into mongoDb? Or will mongoDb force the _id to be different if there is duplication?</p>
  
  <pre class="lang-js prettyprint-override"><code>// Taken from mongoose documentation!
  const personSchema = Schema({
    _id: Schema.Types.ObjectId,
    name: String,
    age: Number,
  });
  
  const Person = mongoose.model('Person', personSchema);
  const author = new Person({
    _id: new mongoose.Types.ObjectId(),
    name: 'Ian Fleming',
    age: 50
  });
  
  author.save(() =&gt; {
    console.log('saved!')
  });
  
  </code></pre>
  
  <p>Basically, what I want to achieve is to create an Id before I save it. I don't want to have to save documents and then collect their _ids.</p>