title: Mongoimport fails due to duplicated ids of documents from another server
body: <p>I have 2 servers (A and B) that are running a node.js API for logging events in a MongoDB database (each server has a different -independent- MongoDB instance)
  Some day I just wanted to turn down server B and migrate its log data to server A by executing mongomport in server B and moving the resulting file to server A (using mongoimport)</p>
  <p>The first time I couldn't complete the mongoimport because the process detected duplicated _ids (the node.js processes use mongoose with default unique index _id)</p>
  <p>Taking into account logs data does not require a unique id at all (but it is mandatory in MongoDB collections to have a unique _id) the mongoimport should have worked but the id didn't.</p>
  <p>In theory, MongoDB ObjectId is guaranteed to be unique in the same collections but in this case, there is the same application running and saving data in 2 independent servers.
  The only solution for this was to remove the _id fields from all records in the exported JSON from server B in order to import them in server A.</p>
  <p><strong>I suppose there should be a better way for doing this because I was very surprised that there were ObjectIds duplicated so easily in 2 different databases.</strong></p>
  <p>Log data consists of documents like this:</p>
  <pre><code>{
      &quot;_id&quot; : ObjectId(&quot;568c5ed728f0e80214860784&quot;),
      &quot;event&quot; : &quot;event1&quot;,
      &quot;clientCode&quot; : &quot;CLIENTCODE01&quot;,
      &quot;created&quot; : ISODate(&quot;2016-01-06T00:24:20.000Z&quot;),
      &quot;updated&quot; : ISODate(&quot;2016-01-06T00:27:00.000Z&quot;)
  }
  </code></pre>
  <p><strong>Important: server A had only CLIENTCODE01 logs while server B had only CLIENTCODE02 logs so the migration to server A goal was to join the 2 clients' log data into one single server.</strong></p>
  <p>Any ideas about how to deal with this?</p>