 <p>The error can occur only if there exists a document in the database with some <code>_id</code>, say <code>ID1</code>, and you are trying to insert a new document which has <code>ID1</code> as its value for <code>_id</code> field.</p> <p>This can be because of the following:</p> <ul> <li>You already have some documents in the collection, and there is a document in the collection and CSV file that share the same <code>_id</code></li> <li>There are just at least two rows in the CSV file that share the same <code>_id</code></li> </ul> <p>If the value of <code>_id</code> field is not critical for you, you can just remove that attribute from your objects read from CSV right in your JavaScript code using <code>delete</code>.</p> <p>Otherwise, you have a conflict, and need to decide what you want to do with duplicate <code>_id</code> documents. If you are ok with overwriting, you can achieve that by having <code>{upsert: 1}</code> option, which will update the document with new values in case if there is one existing with the same <code>_id</code>.</p>