db.moviesScratch.insertMany can't import

Hi, I can’t fix the following error when I run insert many ordered js file into shell mongo

@MD_RAFI_36177 Prior to doing the import was there already a collection with a document that had that ID or was the collection new/created during the bulk import? If the former then you would need to either change the ID or delete the old collection / offending documents, prior to doing the import.

In short MongoShell is telling you there is already a document with a field with that ID assigned, the ID’s have to be unique.

HTH,
Mike

1 Like

Clearly understand, thanks

1 Like